You are here

public function EntityUsageEvent::__construct in Entity Usage 8.2

Same name and namespace in other branches
  1. 8.4 src/Events/EntityUsageEvent.php \Drupal\entity_usage\Events\EntityUsageEvent::__construct()
  2. 8 src/Events/EntityUsageEvent.php \Drupal\entity_usage\Events\EntityUsageEvent::__construct()
  3. 8.3 src/Events/EntityUsageEvent.php \Drupal\entity_usage\Events\EntityUsageEvent::__construct()

EntityUsageEvents constructor.

Parameters

int $target_id: The target entity ID.

string $target_type: The target entity type.

int $source_id: The source entity ID.

string $source_type: The source entity type.

string $source_langcode: The source entity language code.

string $source_vid: The source entity revision ID.

string $method: The method or way the two entities are being referenced.

string $field_name: The name of the field in the source entity using the target entity.

int $count: The number of references to add or remove.

File

src/Events/EntityUsageEvent.php, line 97

Class

EntityUsageEvent
Implementation of Entity Usage events.

Namespace

Drupal\entity_usage\Events

Code

public function __construct($target_id = NULL, $target_type = NULL, $source_id = NULL, $source_type = NULL, $source_langcode = NULL, $source_vid = NULL, $method = NULL, $field_name = NULL, $count = 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;
  $this->method = $method;
  $this->fieldName = $field_name;
  $this->count = $count;
}