class SchedulerEvent in Scheduler 2.x
Wraps a scheduler event for event listeners.
Hierarchy
- class \Drupal\Component\EventDispatcher\Event extends \Symfony\Component\EventDispatcher\Event
- class \Drupal\scheduler\Event\EventBase
- class \Drupal\scheduler\Event\SchedulerEvent
- class \Drupal\scheduler\Event\EventBase
Expanded class hierarchy of SchedulerEvent
File
- src/
Event/ SchedulerEvent.php, line 10
Namespace
Drupal\scheduler\EventView source
class SchedulerEvent extends EventBase {
/**
* Gets the entity object.
*
* @return \Drupal\Core\Entity\EntityInterface
* The entity object that caused the event to fire.
*/
public function getEntity() {
return $this->entity;
}
/**
* Sets the entity object.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity object that caused the event to fire.
*/
public function setEntity(EntityInterface $entity) {
$this->entity = $entity;
}
/**
* Gets the node object (same as the entity object).
*
* This method is retained for backwards compatibility because implementations
* of the event subscriber functions may be using $event->getNode().
*
* @return \Drupal\Core\Entity\EntityInterface
* The entity object that caused the event to fire.
*/
public function getNode() {
return $this->entity;
}
/**
* Sets the node object (same as the entity object).
*
* This method is retained for backwards compatibility because implementations
* of the event subscriber functions may be using $event->setNode().
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity object that caused the event to fire.
*/
public function setNode(EntityInterface $entity) {
$this->entity = $entity;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EventBase:: |
public | property | The entity which is being processed. | |
EventBase:: |
public | function | Constructs the object. | |
SchedulerEvent:: |
public | function | Gets the entity object. | |
SchedulerEvent:: |
public | function | Gets the node object (same as the entity object). | |
SchedulerEvent:: |
public | function | Sets the entity object. | |
SchedulerEvent:: |
public | function | Sets the node object (same as the entity object). |