function IntegrityViolationList::addViolationWithMessage

Creates a new violation with the message and adds it to this list.

Parameters

\Drupal\Core\StringTranslation\TranslatableMarkup $message: The violation message.

string $uuid: (optional) UUID of the expression where the violation occurred.

File

src/Engine/IntegrityViolationList.php, line 71

Class

IntegrityViolationList
Collection of integrity violations.

Namespace

Drupal\rules\Engine

Code

public function addViolationWithMessage(TranslatableMarkup $message, $uuid = NULL) {
    $violation = new IntegrityViolation();
    $violation->setMessage($message);
    $violation->setUuid($uuid);
    $this[] = $violation;
}