private function PreUpdateEventArgs::assertValidField

Assert the field exists in changeset.

Parameters

string $field:

Throws

\InvalidArgumentException

3 calls to PreUpdateEventArgs::assertValidField()
PreUpdateEventArgs::getNewValue in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php
Get the new value of the changeset of the changed field.
PreUpdateEventArgs::getOldValue in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php
Get the old value of the changeset of the changed field.
PreUpdateEventArgs::setNewValue in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php
Set the new value of this field.

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php, line 122

Class

PreUpdateEventArgs
Class that holds event arguments for a preUpdate event.

Namespace

Doctrine\Common\Persistence\Event

Code

private function assertValidField($field) {
  if (!isset($this->entityChangeSet[$field])) {
    throw new \InvalidArgumentException(sprintf('Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.', $field, get_class($this
      ->getEntity())));
  }
}