class ShouldCreateJobEvent in Translation Management Tool 8
Represents a job item about to be added to a continuous job.
Hierarchy
- class \Drupal\tmgmt\Events\ShouldCreateJobEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of ShouldCreateJobEvent
See also
\Drupal\tmgmt\ContinuousSourceInterface::shouldCreateContinuousItem()
2 files declare their use of ShouldCreateJobEvent
- ContinuousManager.php in src/
ContinuousManager.php - TestContinuousEventSubscriber.php in tmgmt_test/
src/ EventSubscriber/ TestContinuousEventSubscriber.php
File
- src/
Events/ ShouldCreateJobEvent.php, line 13
Namespace
Drupal\tmgmt\EventsView source
class ShouldCreateJobEvent extends Event {
/**
* Continuous job entity.
*
* @var \Drupal\tmgmt\JobInterface
*/
protected $job;
/**
* The plugin ID.
*
* @var string
*/
protected $plugin;
/**
* The item type.
*
* @var string
*/
protected $itemType;
/**
* The source item id.
*
* @var string
*/
protected $itemId;
/**
* Whether or not the job should be created.
*
* @var bool
*/
protected $shouldCreateItem;
/**
* ShouldCreateJobEvent constructor.
*
* @param \Drupal\tmgmt\JobInterface $job
* Continuous job.
* @param string $plugin
* The plugin name.
* @param string $item_type
* The source item type.
* @param string $item_id
* The source item id.
* @param bool $should_create_item
* Whether or not the item should be created.
*/
public function __construct(JobInterface $job, $plugin, $item_type, $item_id, $should_create_item) {
$this->job = $job;
$this->plugin = $plugin;
$this->itemType = $item_type;
$this->itemId = $item_id;
$this->shouldCreateItem = $should_create_item;
}
/**
* Gets the job entity.
*
* @return \Drupal\tmgmt\JobInterface
* The Job object.
*/
public function getJob() {
return $this->job;
}
/**
* Gets the plugin ID.
*
* @return string
* The plugin ID.
*/
public function getPlugin() {
return $this->plugin;
}
/**
* Gets the item type.
*
* @return string
* The item type.
*/
public function getItemType() {
return $this->itemType;
}
/**
* Gets the item id.
*
* @return string
* The item id.
*/
public function getItemId() {
return $this->itemId;
}
/**
* Returns whether the job item should be created.
*
* @return bool
* Whether or not the job item should be created.
*/
public function shouldCreateItem() {
return $this->shouldCreateItem;
}
/**
* Sets whether or not the job item should be created.
*
* @param bool $should_create_item
* TRUE if the job item should be created, FALSE if not.
*/
public function setShouldCreateItem($should_create_item) {
$this->shouldCreateItem = $should_create_item;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ShouldCreateJobEvent:: |
protected | property | The source item id. | |
ShouldCreateJobEvent:: |
protected | property | The item type. | |
ShouldCreateJobEvent:: |
protected | property | Continuous job entity. | |
ShouldCreateJobEvent:: |
protected | property | The plugin ID. | |
ShouldCreateJobEvent:: |
protected | property | Whether or not the job should be created. | |
ShouldCreateJobEvent:: |
public | function | Gets the item id. | |
ShouldCreateJobEvent:: |
public | function | Gets the item type. | |
ShouldCreateJobEvent:: |
public | function | Gets the job entity. | |
ShouldCreateJobEvent:: |
public | function | Gets the plugin ID. | |
ShouldCreateJobEvent:: |
public | function | Sets whether or not the job item should be created. | |
ShouldCreateJobEvent:: |
public | function | Returns whether the job item should be created. | |
ShouldCreateJobEvent:: |
public | function | ShouldCreateJobEvent constructor. |