You are here

interface EntityReferenceDependencyManagerInterface in Entity Reference Integrity 8

An interface for calculating entity dependency.

Hierarchy

Expanded class hierarchy of EntityReferenceDependencyManagerInterface

All classes that implement EntityReferenceDependencyManagerInterface

2 files declare their use of EntityReferenceDependencyManagerInterface
EntityPredelete.php in modules/entity_reference_integrity_enforce/src/EntityPredelete.php
FormAlter.php in modules/entity_reference_integrity_enforce/src/FormAlter.php

File

src/EntityReferenceDependencyManagerInterface.php, line 10

Namespace

Drupal\entity_reference_integrity
View source
interface EntityReferenceDependencyManagerInterface {

  /**
   * Check if an entity has dependent entties.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   An entity.
   *
   * @return bool
   *   If the entity is referenced from elsewhere.
   */
  public function hasDependents(EntityInterface $entity);

  /**
   * List the entities that reference the given entity.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity.
   *
   * @return array
   *   Array of entity type IDs with arrays of loaded entities.
   */
  public function getDependentEntities(EntityInterface $entity);

  /**
   * List the entity IDs that reference the given entity.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity.
   *
   * @return array
   *   Array of entity type IDs with arrays of entity IDs.
   */
  public function getDependentEntityIds(EntityInterface $entity);

  /**
   * Build an access denied reason string.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity that has dependents.
   * @param bool $translate
   *   Optional boolean to translate the string. Defaults to TRUE.
   *
   * @return string
   */
  public static function getAccessDeniedReason(EntityInterface $entity, bool $translate = TRUE);

}

Members

Namesort descending Modifiers Type Description Overrides
EntityReferenceDependencyManagerInterface::getAccessDeniedReason public static function Build an access denied reason string. 2
EntityReferenceDependencyManagerInterface::getDependentEntities public function List the entities that reference the given entity. 2
EntityReferenceDependencyManagerInterface::getDependentEntityIds public function List the entity IDs that reference the given entity. 2
EntityReferenceDependencyManagerInterface::hasDependents public function Check if an entity has dependent entties. 2