function ValidReferenceConstraintValidator::create

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraintValidator.php \Drupal\Core\Entity\Plugin\Validation\Constraint\ValidReferenceConstraintValidator::create()
  2. 10 core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraintValidator.php \Drupal\Core\Entity\Plugin\Validation\Constraint\ValidReferenceConstraintValidator::create()
  3. 11.x core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraintValidator.php \Drupal\Core\Entity\Plugin\Validation\Constraint\ValidReferenceConstraintValidator::create()

Overrides ContainerInjectionInterface::create

File

core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraintValidator.php, line 48

Class

ValidReferenceConstraintValidator
Checks if referenced entities are valid.

Namespace

Drupal\Core\Entity\Plugin\Validation\Constraint

Code

public static function create(ContainerInterface $container) {
    return new static($container->get('plugin.manager.entity_reference_selection'), $container->get('entity_type.manager'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.