You are here

class EntityUsageEvent in Entity Usage 8.3

Same name and namespace in other branches
  1. 8.4 src/Events/EntityUsageEvent.php \Drupal\entity_usage\Events\EntityUsageEvent
  2. 8 src/Events/EntityUsageEvent.php \Drupal\entity_usage\Events\EntityUsageEvent
  3. 8.2 src/Events/EntityUsageEvent.php \Drupal\entity_usage\Events\EntityUsageEvent

Implementation of Entity Usage events.

Hierarchy

  • class \Drupal\entity_usage\Events\EntityUsageEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of EntityUsageEvent

2 files declare their use of EntityUsageEvent
EntityUsage.php in src/EntityUsage.php
EntityUsageTest.php in tests/src/Kernel/EntityUsageTest.php

File

src/Events/EntityUsageEvent.php, line 10

Namespace

Drupal\entity_usage\Events
View source
class EntityUsageEvent extends Event {

  /**
   * The target entity ID.
   *
   * @var string
   */
  protected $targetEntityId;

  /**
   * The target entity type.
   *
   * @var string
   */
  protected $targetEntityType;

  /**
   * The source entity ID.
   *
   * @var string
   */
  protected $sourceEntityId;

  /**
   * The source entity type.
   *
   * @var string
   */
  protected $sourceEntityType;

  /**
   * The source entity language code.
   *
   * @var string
   */
  protected $sourceEntityLangcode;

  /**
   * The source entity revision ID.
   *
   * @var string
   */
  protected $sourceEntityRevisionId;

  /**
   * EntityUsageEvents constructor.
   *
   * @param int $target_id
   *   The target entity ID.
   * @param string $target_type
   *   The target entity type.
   * @param int $source_id
   *   The source entity ID.
   * @param string $source_type
   *   The source entity type.
   * @param string $source_langcode
   *   The source entity language code.
   * @param string $source_vid
   *   The source entity revision ID.
   */
  public function __construct($target_id = NULL, $target_type = NULL, $source_id = NULL, $source_type = NULL, $source_langcode = NULL, $source_vid = NULL) {
    $this->targetEntityId = $target_id;
    $this->targetEntityType = $target_type;
    $this->sourceEntityId = $source_id;
    $this->sourceEntityType = $source_type;
    $this->sourceEntityLangcode = $source_langcode;
    $this->sourceEntityRevisionId = $source_vid;
  }

  /**
   * Sets the target entity id.
   *
   * @param int $id
   *   The target entity id.
   */
  public function setTargetEntityId($id) {
    $this->targetEntityId = $id;
  }

  /**
   * Sets the target entity type.
   *
   * @param string $type
   *   The target entity type.
   */
  public function setTargetEntityType($type) {
    $this->targetEntityType = $type;
  }

  /**
   * Sets the source entity id.
   *
   * @param int $id
   *   The source entity id.
   */
  public function setSourceEntityId($id) {
    $this->sourceEntityId = $id;
  }

  /**
   * Sets the source entity type.
   *
   * @param string $type
   *   The source entity type.
   */
  public function setSourceEntityType($type) {
    $this->sourceEntityType = $type;
  }

  /**
   * Sets the source entity language code.
   *
   * @param string $langcode
   *   The source entity language code.
   */
  public function setSourceEntityLangcode($langcode) {
    $this->sourceEntityLangcode = $langcode;
  }

  /**
   * Sets the source entity revision ID.
   *
   * @param string $vid
   *   The source entity revision ID.
   */
  public function setSourceEntityRevisionId($vid) {
    $this->sourceEntityRevisionId = $vid;
  }

  /**
   * Gets the target entity id.
   *
   * @return null|string
   *   The target entity id or NULL.
   */
  public function getTargetEntityId() {
    return $this->targetEntityId;
  }

  /**
   * Gets the target entity type.
   *
   * @return null|string
   *   The target entity type or NULL.
   */
  public function getTargetEntityType() {
    return $this->targetEntityType;
  }

  /**
   * Gets the source entity id.
   *
   * @return null|int
   *   The source entity id or NULL.
   */
  public function getSourceEntityId() {
    return $this->sourceEntityId;
  }

  /**
   * Gets the source entity type.
   *
   * @return null|string
   *   The source entity type or NULL.
   */
  public function getSourceEntityType() {
    return $this->sourceEntityType;
  }

  /**
   * Gets the source entity language code.
   *
   * @return null|string
   *   The source entity language code or NULL.
   */
  public function getSourceEntityLangcode() {
    return $this->sourceEntityLangcode;
  }

  /**
   * Gets the source entity revision ID.
   *
   * @return null|string
   *   The source entity revision ID or NULL.
   */
  public function getSourceEntityRevisionId() {
    return $this->sourceEntityRevisionId;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityUsageEvent::$sourceEntityId protected property The source entity ID.
EntityUsageEvent::$sourceEntityLangcode protected property The source entity language code.
EntityUsageEvent::$sourceEntityRevisionId protected property The source entity revision ID.
EntityUsageEvent::$sourceEntityType protected property The source entity type.
EntityUsageEvent::$targetEntityId protected property The target entity ID.
EntityUsageEvent::$targetEntityType protected property The target entity type.
EntityUsageEvent::getSourceEntityId public function Gets the source entity id.
EntityUsageEvent::getSourceEntityLangcode public function Gets the source entity language code.
EntityUsageEvent::getSourceEntityRevisionId public function Gets the source entity revision ID.
EntityUsageEvent::getSourceEntityType public function Gets the source entity type.
EntityUsageEvent::getTargetEntityId public function Gets the target entity id.
EntityUsageEvent::getTargetEntityType public function Gets the target entity type.
EntityUsageEvent::setSourceEntityId public function Sets the source entity id.
EntityUsageEvent::setSourceEntityLangcode public function Sets the source entity language code.
EntityUsageEvent::setSourceEntityRevisionId public function Sets the source entity revision ID.
EntityUsageEvent::setSourceEntityType public function Sets the source entity type.
EntityUsageEvent::setTargetEntityId public function Sets the target entity id.
EntityUsageEvent::setTargetEntityType public function Sets the target entity type.
EntityUsageEvent::__construct public function EntityUsageEvents constructor.