EntityConstraintViolationListInterface::filterByFields

public EntityConstraintViolationListInterface::filterByFields(array $field_names) Filters this violation list by the given fields. The returned object just has violations attached to the provided fields. When violations should be displayed for a sub-set of visible fields only, this method may be used to filter the set of visible violations first. Parameters string[] $field_names: The names of the fields to filter violations for. Return value $this File core/lib/Drupal/Core/Entity/EntityConstr

EntityConstraintViolationListInterface::filterByFieldAccess

public EntityConstraintViolationListInterface::filterByFieldAccess(AccountInterface $account = NULL) Filters this violation list to apply for accessible fields only. Violations for inaccessible fields are removed so the returned object just has the remaining violations. Parameters \Drupal\Core\Session\AccountInterface $account: (optional) The user for which to check access, or NULL to check access for the current user. Defaults to NULL. Return value $this File core/lib/Drupal/Core/Entity/Enti

EntityConstraintViolationListInterface

Interface for the result of entity validation. The Symfony violation list is extended with methods that allow filtering violations by fields and field access. Forms leverage that to skip possibly pre-existing violations that cannot be caused or fixed by the form. Hierarchy interface \Symfony\Component\Validator\ConstraintViolationListInterface extends \Traversableinterface \Drupal\Core\Entity\EntityConstraintViolationListInterface File core/lib/Drupal/Core/Entity/EntityConstraintViolationLi

EntityConstraintViolationList::__construct

public EntityConstraintViolationList::__construct(FieldableEntityInterface $entity, array $violations = array()) Parameters \Drupal\Core\Entity\FieldableEntityInterface $entity: The entity that has been validated. array $violations: The array of violations. Overrides ConstraintViolationList::__construct File core/lib/Drupal/Core/Entity/EntityConstraintViolationList.php, line 50 Class EntityConstraintViolationList Implements an entity constraint violation list. Namespace Drupal\Core\Ent

EntityConstraintViolationList::set

public EntityConstraintViolationList::set($offset, ConstraintViolationInterface $violation) Sets a violation at a given offset. Parameters int $offset The violation offset.: ConstraintViolationInterface $violation The violation.: Overrides ConstraintViolationList::set File core/lib/Drupal/Core/Entity/EntityConstraintViolationList.php, line 204 Class EntityConstraintViolationList Implements an entity constraint violation list. Namespace Drupal\Core\Entity Code public function set($offs

EntityConstraintViolationList::remove

public EntityConstraintViolationList::remove($offset) Removes a violation at a given offset. Parameters int $offset The offset to remove.: Overrides ConstraintViolationList::remove File core/lib/Drupal/Core/Entity/EntityConstraintViolationList.php, line 195 Class EntityConstraintViolationList Implements an entity constraint violation list. Namespace Drupal\Core\Entity Code public function remove($offset) { parent::remove($offset); $this->violationOffsetsByField = NULL; $this-

EntityConstraintViolationList::groupViolationOffsets

protected EntityConstraintViolationList::groupViolationOffsets() Groups violation offsets by field and entity level. Sets the $violationOffsetsByField and $entityViolationOffsets properties. File core/lib/Drupal/Core/Entity/EntityConstraintViolationList.php, line 60 Class EntityConstraintViolationList Implements an entity constraint violation list. Namespace Drupal\Core\Entity Code protected function groupViolationOffsets() { if (!isset($this->violationOffsetsByField)) { $this

EntityConstraintViolationList::getFieldNames

public EntityConstraintViolationList::getFieldNames() Returns the names of all violated fields. Return value string[] An array of field names. Overrides EntityConstraintViolationListInterface::getFieldNames File core/lib/Drupal/Core/Entity/EntityConstraintViolationList.php, line 171 Class EntityConstraintViolationList Implements an entity constraint violation list. Namespace Drupal\Core\Entity Code public function getFieldNames() { $this->groupViolationOffsets(); return array_k

EntityConstraintViolationList::getEntityViolations

public EntityConstraintViolationList::getEntityViolations() Gets violations flagged on entity level, not associated with any field. Return value \Drupal\Core\Entity\EntityConstraintViolationListInterface A list of violations on the entity level. Overrides EntityConstraintViolationListInterface::getEntityViolations File core/lib/Drupal/Core/Entity/EntityConstraintViolationList.php, line 82 Class EntityConstraintViolationList Implements an entity constraint violation list. Namespace Drup

EntityConstraintViolationList::getEntity

public EntityConstraintViolationList::getEntity() The entity which has been validated. Return value \Drupal\Core\Entity\FieldableEntityInterface The entity object. Overrides EntityConstraintViolationListInterface::getEntity File core/lib/Drupal/Core/Entity/EntityConstraintViolationList.php, line 179 Class EntityConstraintViolationList Implements an entity constraint violation list. Namespace Drupal\Core\Entity Code public function getEntity() { return $this->entity; }