private function PersistentObject::get

Get persistent field value.

Parameters

string $field:

Return value

mixed

Throws

\BadMethodCallException - When no persistent field exists by that name.

1 call to PersistentObject::get()
PersistentObject::__call in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php
Magic method that implements

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php, line 143

Class

PersistentObject
PersistentObject base class that implements getter/setter methods for all mapped fields and associations by overriding __call.

Namespace

Doctrine\Common\Persistence

Code

private function get($field) {
  $this
    ->initializeDoctrine();
  if ($this->cm
    ->hasField($field) || $this->cm
    ->hasAssociation($field)) {
    return $this->{$field};
  }
  else {
    throw new \BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm
      ->getName() . "'");
  }
}