You are here

EventBase.php in Scheduler 2.x

File

src/Event/EventBase.php
View source
<?php

namespace Drupal\scheduler\Event;


// Drupal\Component\EventDispatcher\Event was introduced in Drupal core 9.1 to
// assist with deprecations and the transition to Symfony 5.
// @todo Remove this when core 9.1 is the lowest supported version.
// @see https://www.drupal.org/project/scheduler/issues/3166688
if (!class_exists('Drupal\\Component\\EventDispatcher\\Event')) {
  class_alias('Symfony\\Component\\EventDispatcher\\Event', 'Drupal\\Component\\EventDispatcher\\Event');
}
use Drupal\Component\EventDispatcher\Event;
use Drupal\Core\Entity\EntityInterface;

/**
 * Base class on which all Scheduler events are extended.
 */
class EventBase extends Event {

  /**
   * The entity which is being processed.
   *
   * @var \Drupal\Core\Entity\EntityInterface
   */
  public $entity;

  /**
   * Constructs the object.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity which is being processed.
   */
  public function __construct(EntityInterface $entity) {
    $this->entity = $entity;
  }

}

Classes

Namesort descending Description
EventBase Base class on which all Scheduler events are extended.