function SandboxValidationEvent::addError
Convenience method to flag a validation error.
Parameters
\Drupal\Core\StringTranslation\TranslatableMarkup[] $messages: The error messages.
\Drupal\Core\StringTranslation\TranslatableMarkup|null $summary: The summary of error messages. Must be passed if there is more than one message.
File
-
core/
modules/ package_manager/ src/ Event/ SandboxValidationEvent.php, line 51
Class
- SandboxValidationEvent
- Base class for events dispatched before a stage life cycle operation.
Namespace
Drupal\package_manager\EventCode
public function addError(array $messages, ?TranslatableMarkup $summary = NULL) : void {
$this->addResult(ValidationResult::createError(array_values($messages), $summary));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.