class EntityReferenceDependencyManager in Entity Reference Integrity 8
Calculate entity dependencies based on entity reference fields.
Hierarchy
- class \Drupal\entity_reference_integrity\EntityReferenceDependencyManager implements EntityReferenceDependencyManagerInterface
Expanded class hierarchy of EntityReferenceDependencyManager
Deprecated
Use the entity handler instead.
1 string reference to 'EntityReferenceDependencyManager'
1 service uses EntityReferenceDependencyManager
File
- src/
EntityReferenceDependencyManager.php, line 13
Namespace
Drupal\entity_reference_integrityView source
class EntityReferenceDependencyManager implements EntityReferenceDependencyManagerInterface {
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Create an EntityReferenceDependencyManager.
*/
public function __construct(EntityTypeManagerInterface $entityTypeManager) {
$this->entityTypeManager = $entityTypeManager;
}
/**
* {@inheritdoc}
*/
public function hasDependents(EntityInterface $entity) {
return $this->entityTypeManager
->getHandler($entity
->getEntityTypeId(), 'entity_reference_integrity')
->hasDependents($entity);
}
/**
* {@inheritdoc}
*/
public function getDependentEntityIds(EntityInterface $entity) {
return $this->entityTypeManager
->getHandler($entity
->getEntityTypeId(), 'entity_reference_integrity')
->getDependentEntityIds($entity);
}
/**
* {@inheritdoc}
*/
public function getDependentEntities(EntityInterface $entity) {
return $this->entityTypeManager
->getHandler($entity
->getEntityTypeId(), 'entity_reference_integrity')
->getDependentEntities($entity);
}
/**
* {@inheritdoc}
*/
public static function getAccessDeniedReason(EntityInterface $entity, bool $translate = TRUE) {
return EntityReferenceIntegrityEntityHandler::getAccessDeniedReason($entity, $translate);
}
}