You are here

public function ValidHierarchyReferenceConstraintValidator::__construct in Entity Reference Hierarchy 3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/Validation/Constraint/ValidHierarchyReferenceConstraintValidator.php \Drupal\entity_hierarchy\Plugin\Validation\Constraint\ValidHierarchyReferenceConstraintValidator::__construct()

Constructs a ValidReferenceConstraintValidator object.

Parameters

\Drupal\entity_hierarchy\Storage\NestedSetStorageFactory $nestedSetStorageFactory: Nested set factory.

\Drupal\entity_hierarchy\Storage\NestedSetNodeKeyFactory $keyFactory: Key factory.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

File

src/Plugin/Validation/Constraint/ValidHierarchyReferenceConstraintValidator.php, line 50

Class

ValidHierarchyReferenceConstraintValidator
Checks if referenced entities are valid.

Namespace

Drupal\entity_hierarchy\Plugin\Validation\Constraint

Code

public function __construct(NestedSetStorageFactory $nestedSetStorageFactory, NestedSetNodeKeyFactory $keyFactory, EntityTypeManagerInterface $entity_type_manager) {
  $this->entityTypeManager = $entity_type_manager;
  $this->nestedSetStorageFactory = $nestedSetStorageFactory;
  $this->keyFactory = $keyFactory;
}