You are here

private function PreUpdateEventArgs::assertValidField in Plug 7

Asserts the field exists in changeset.

Parameters

string $field:

Return value

void

Throws

\InvalidArgumentException

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

File

lib/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php, line 127

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())));
  }
}