Skip to content
Snippets Groups Projects

Issue #3512440 by a.dmitriiev: Support project browser 2.0

Files
3
+ 74
0
<?php
namespace Drupal\project_browser_gitlab\Event;
use Drupal\Component\EventDispatcher\Event;
use Drupal\project_browser_gitlab\GitlabSourceInterface;
/**
* Class for project event to modify the information from Gitlab API if needed.
*/
class ProjectEvent extends Event {
/**
* The project info from Gitlab.
*
* @var array
*/
protected $project;
/**
* The gitlab source.
*
* @var \Drupal\project_browser_gitlab\GitlabSourceInterface
*/
protected GitlabSourceInterface $gitlabSource;
/**
* Constructs the event object.
*
* @param array $project
* The project info from Gitlab API response.
* @param \Drupal\project_browser_gitlab\GitlabSourceInterface $gitlab_source
* The Gitlab Source entity.
*/
public function __construct(array $project, GitlabSourceInterface $gitlab_source) {
$this->project = $project;
$this->gitlabSource = $gitlab_source;
}
/**
* Gets the project info.
*
* @return array
* The project info.
*/
public function getProject() {
return $this->project;
}
/**
* Gets the Gitlab Source entity.
*
* @return \Drupal\project_browser_gitlab\GitlabSourceInterface
* The Gitlab Source entity.
*/
public function getGitlabSource() {
return $this->gitlabSource;
}
/**
* Sets the project.
*
* @param array $project
* The modified project.
*
* @return self
* The event object.
*/
public function setProject(array $project) {
$this->project = $project;
return $this;
}
}
Loading