You are here

public function EntityUsageInterface::listUsage in Entity Usage 8.4

Same name and namespace in other branches
  1. 8 src/EntityUsageInterface.php \Drupal\entity_usage\EntityUsageInterface::listUsage()
  2. 8.2 src/EntityUsageInterface.php \Drupal\entity_usage\EntityUsageInterface::listUsage()

Determines where an entity is used (deprecated).

This method should not be used in new integrations, and is only provided as BC-layer for existing implementations. Note however that the count returned on 2.x will be different from the count returned on 1.x, once now we track all revisions / translations independently.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: A target (referenced) entity.

bool $include_method: (optional) Whether the results must be wrapped into an additional array level, by the reference method. Defaults to FALSE.

Return value

array A nested array with usage data.The first level is keyed by the type of the source entity, the second by the referencing objects ID. The value of the second level contains the usage count, which will be summed for all revisions and translations tracked. Note that if $include_method is TRUE, the first level is keyed by the reference method, and the second level will continue as explained above.

Deprecated

in branch 2.x. Use \Drupal\entity_usage\EntityUsageInterface::listSources() instead.

1 method overrides EntityUsageInterface::listUsage()
EntityUsage::listUsage in src/EntityUsage.php
Determines where an entity is used (deprecated).

File

src/EntityUsageInterface.php, line 200

Class

EntityUsageInterface
Entity usage interface.

Namespace

Drupal\entity_usage

Code

public function listUsage(EntityInterface $entity, $include_method = FALSE);