You are here

class SchedulerEvent in Scheduler 2.x

Wraps a scheduler event for event listeners.

Hierarchy

  • class \Drupal\Component\EventDispatcher\Event extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of SchedulerEvent

File

src/Event/SchedulerEvent.php, line 10

Namespace

Drupal\scheduler\Event
View 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

Namesort descending Modifiers Type Description Overrides
EventBase::$entity public property The entity which is being processed.
EventBase::__construct public function Constructs the object.
SchedulerEvent::getEntity public function Gets the entity object.
SchedulerEvent::getNode public function Gets the node object (same as the entity object).
SchedulerEvent::setEntity public function Sets the entity object.
SchedulerEvent::setNode public function Sets the node object (same as the entity object).