You are here

class ReferenceAccessConstraint in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ReferenceAccessConstraint.php \Drupal\Core\Entity\Plugin\Validation\Constraint\ReferenceAccessConstraint

Entity Reference valid reference constraint.

Verifies that referenced entities are valid.

Plugin annotation


@Constraint(
  id = "ReferenceAccess",
  label = @Translation("Entity Reference reference access", context = "Validation")
)

Hierarchy

  • class \Drupal\Core\Entity\Plugin\Validation\Constraint\ReferenceAccessConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of ReferenceAccessConstraint

File

core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ReferenceAccessConstraint.php, line 17

Namespace

Drupal\Core\Entity\Plugin\Validation\Constraint
View source
class ReferenceAccessConstraint extends Constraint {

  /**
   * The default violation message.
   *
   * @var string
   */
  public $message = 'You do not have access to the referenced entity (%type: %id).';

}

Members

Namesort descending Modifiers Type Description Overrides
ReferenceAccessConstraint::$message public property The default violation message.