function EntityValidationException::getViolationMessages

Same name in other branches
  1. 9 core/modules/migrate/src/Exception/EntityValidationException.php \Drupal\migrate\Exception\EntityValidationException::getViolationMessages()
  2. 10 core/modules/migrate/src/Exception/EntityValidationException.php \Drupal\migrate\Exception\EntityValidationException::getViolationMessages()
  3. 11.x core/modules/migrate/src/Exception/EntityValidationException.php \Drupal\migrate\Exception\EntityValidationException::getViolationMessages()

Returns the list of violation messages.

Return value

string[] The list of violation messages.

1 call to EntityValidationException::getViolationMessages()
EntityValidationException::__construct in core/modules/migrate/src/Exception/EntityValidationException.php
EntityValidationException constructor.

File

core/modules/migrate/src/Exception/EntityValidationException.php, line 66

Class

EntityValidationException
To throw when an entity generated during the import is not valid.

Namespace

Drupal\migrate\Exception

Code

public function getViolationMessages() {
    $messages = [];
    foreach ($this->violations as $violation) {
        assert($violation instanceof ConstraintViolationInterface);
        $messages[] = sprintf('%s=%s', $violation->getPropertyPath(), $violation->getMessage());
    }
    return $messages;
}

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