You are here

class EntityUsageEvent in Entity Usage 8

Same name and namespace in other branches
  1. 8.4 src/Events/EntityUsageEvent.php \Drupal\entity_usage\Events\EntityUsageEvent
  2. 8.2 src/Events/EntityUsageEvent.php \Drupal\entity_usage\Events\EntityUsageEvent
  3. 8.3 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 identifier of the target entity.
   *
   * @var string
   */
  protected $targetEntityId;

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

  /**
   * The identifier of the referencing entity.
   *
   * @var string
   */
  protected $referencingEntityId;

  /**
   * The type of the entity that is referencing.
   *
   * @var string
   */
  protected $referencingEntityType;

  /**
   * The method or way the two entities are being referenced.
   *
   * @var string
   */
  protected $method;

  /**
   * The number of references to add or remove.
   *
   * @var string
   */
  protected $count;

  /**
   * EntityUsageEvents constructor.
   *
   * @param int $t_id
   *   The identifier of the target entity.
   * @param string $t_type
   *   The type of the target entity.
   * @param int $re_id
   *   The identifier of the referencing entity.
   * @param string $re_type
   *   The type of the entity that is referencing.
   * @param string $method
   *   The method or way the two entities are being referenced.
   * @param int $count
   *   The number of references to add or remove.
   */
  public function __construct($t_id = NULL, $t_type = NULL, $re_id = NULL, $re_type = NULL, $method = NULL, $count = NULL) {
    $this->targetEntityId = $t_id;
    $this->targetEntityType = $t_type;
    $this->referencingEntityId = $re_id;
    $this->referencingEntityType = $re_type;
    $this->method = $method;
    $this->count = $count;
  }

  /**
   * 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 referencing entity id.
   *
   * @param int $id
   *   The referencing entity id.
   */
  public function setReferencingEntityId($id) {
    $this->referencingEntityId = $id;
  }

  /**
   * Sets the referencing entity type.
   *
   * @param string $type
   *   The referencing entity type.
   */
  public function setReferencingEntityType($type) {
    $this->referencingEntityType = $type;
  }

  /**
   * Sets the referencing method.
   *
   * @param string $method
   *   The referencing method.
   */
  public function setReferencingMethod($method) {
    $this->method = $method;
  }

  /**
   * Sets the count.
   *
   * @param int $count
   *   The number od references to add or remove.
   */
  public function setCount($count) {
    $this->count = $count;
  }

  /**
   * 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 referencing entity id.
   *
   * @return int|null
   *   The referencing entity id or NULL.
   */
  public function getReferencingEntityId() {
    return $this->referencingEntityId;
  }

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

  /**
   * Gets the referencing method.
   *
   * @return null|string
   *   The referencing method or NULL.
   */
  public function getReferencingMethod() {
    return $this->method;
  }

  /**
   * Gets the count.
   *
   * @return int|null
   *   The number of references to add or remove or NULL.
   */
  public function getCount() {
    return $this->count;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityUsageEvent::$count protected property The number of references to add or remove.
EntityUsageEvent::$method protected property The method or way the two entities are being referenced.
EntityUsageEvent::$referencingEntityId protected property The identifier of the referencing entity.
EntityUsageEvent::$referencingEntityType protected property The type of the entity that is referencing.
EntityUsageEvent::$targetEntityId protected property The identifier of the target entity.
EntityUsageEvent::$targetEntityType protected property The type of the target entity.
EntityUsageEvent::getCount public function Gets the count.
EntityUsageEvent::getReferencingEntityId public function Gets the referencing entity id.
EntityUsageEvent::getReferencingEntityType public function Gets the referencing entity type.
EntityUsageEvent::getReferencingMethod public function Gets the referencing method.
EntityUsageEvent::getTargetEntityId public function Gets the target entity id.
EntityUsageEvent::getTargetEntityType public function Gets the target entity type.
EntityUsageEvent::setCount public function Sets the count.
EntityUsageEvent::setReferencingEntityId public function Sets the referencing entity id.
EntityUsageEvent::setReferencingEntityType public function Sets the referencing entity type.
EntityUsageEvent::setReferencingMethod public function Sets the referencing method.
EntityUsageEvent::setTargetEntityId public function Sets the target entity id.
EntityUsageEvent::setTargetEntityType public function Sets the target entity type.
EntityUsageEvent::__construct public function EntityUsageEvents constructor.