You are here

abstract class FlagEventBase in Flag 8.4

Base Event from which other flag event are defined.

Hierarchy

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

Expanded class hierarchy of FlagEventBase

File

src/Event/FlagEventBase.php, line 12

Namespace

Drupal\flag\Event
View source
abstract class FlagEventBase extends Event {

  /**
   * The Flag in question.
   *
   * @var \Drupal\flag\FlagInterface
   */
  protected $flag;

  /**
   * Build the flag event class.
   *
   * @param \Drupal\flag\FlagInterface $flag
   *   The flag to be acted upon.
   */
  public function __construct(FlagInterface $flag) {
    $this->flag = $flag;
  }

  /**
   * Get the flag entity related to the event.
   *
   * @return \Drupal\flag\FlagInterface
   *   The flag related to the event.
   */
  public function getFlag() {
    return $this->flag;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FlagEventBase::$flag protected property The Flag in question.
FlagEventBase::getFlag public function Get the flag entity related to the event.
FlagEventBase::__construct public function Build the flag event class.