You are here

class IntegrityViolation in Rules 8.3

Holds information about an integrity violation in a Rules expression.

Hierarchy

Expanded class hierarchy of IntegrityViolation

1 file declares its use of IntegrityViolation
ContextHandlerIntegrityTrait.php in src/Context/ContextHandlerIntegrityTrait.php

File

src/Engine/IntegrityViolation.php, line 10

Namespace

Drupal\rules\Engine
View source
class IntegrityViolation implements IntegrityViolationInterface {

  /**
   * The user facing message of this violation.
   *
   * @var \Drupal\Core\StringTranslation\TranslatableMarkup
   */
  protected $message;

  /**
   * The associated context name (optional).
   *
   * @var string
   */
  protected $contextName;

  /**
   * The UUID of the expression where the violation occurred.
   *
   * @var string
   */
  protected $uuid;

  /**
   * {@inheritdoc}
   */
  public function setMessage(TranslatableMarkup $message) {
    $this->message = $message;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getMessage() {
    return $this->message;
  }

  /**
   * {@inheritdoc}
   */
  public function setContextName($context_name) {
    $this->contextName = $context_name;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getContextName() {
    return $this->contextName;
  }

  /**
   * {@inheritdoc}
   */
  public function setUuid($uuid) {
    $this->uuid = $uuid;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getUuid() {
    return $this->uuid;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
IntegrityViolation::$contextName protected property The associated context name (optional).
IntegrityViolation::$message protected property The user facing message of this violation.
IntegrityViolation::$uuid protected property The UUID of the expression where the violation occurred.
IntegrityViolation::getContextName public function Returns the associated context name, if there is one. Overrides IntegrityViolationInterface::getContextName
IntegrityViolation::getMessage public function Returns the translated message of this violation. Overrides IntegrityViolationInterface::getMessage
IntegrityViolation::getUuid public function Returns the UUID of the expression this violation belongs to. Overrides IntegrityViolationInterface::getUuid
IntegrityViolation::setContextName public function Sets the context name when this violation should be associated to one. Overrides IntegrityViolationInterface::setContextName
IntegrityViolation::setMessage public function Sets the user facing message that can be displayed for this violation. Overrides IntegrityViolationInterface::setMessage
IntegrityViolation::setUuid public function Sets the UUID of the nested expression where this violation occurred. Overrides IntegrityViolationInterface::setUuid