_entityPersister = $entityPersister; $this->_identifier = $identifier; } /** @private */ public function __load() { if (!$this->__isInitialized__ && $this->_entityPersister) { $this->__isInitialized__ = true; if (method_exists($this, "__wakeup")) { // call this after __isInitialized__to avoid infinite recursion // but before loading to emulate what ClassMetadata::newInstance() // provides. $this->__wakeup(); } if ($this->_entityPersister->load($this->_identifier, $this) === null) { throw new \Doctrine\ORM\EntityNotFoundException(); } unset($this->_entityPersister, $this->_identifier); } } public function getId() { $this->__load(); return parent::getId(); } public function setUsrId($usrId) { $this->__load(); return parent::setUsrId($usrId); } public function getUsrId() { $this->__load(); return parent::getUsrId(); } public function addValidationData(\Entities\ValidationData $datases) { $this->__load(); return parent::addValidationData($datases); } public function getDatases() { $this->__load(); return parent::getDatases(); } public function setSession(\Entities\ValidationSession $session) { $this->__load(); return parent::setSession($session); } public function getSession() { $this->__load(); return parent::getSession(); } public function setIsAware($isAware) { $this->__load(); return parent::setIsAware($isAware); } public function getIsAware() { $this->__load(); return parent::getIsAware(); } public function __sleep() { return array('__isInitialized__', 'id', 'usr_id', 'is_aware', 'datases', 'session'); } public function __clone() { if (!$this->__isInitialized__ && $this->_entityPersister) { $this->__isInitialized__ = true; $class = $this->_entityPersister->getClassMetadata(); $original = $this->_entityPersister->load($this->_identifier); if ($original === null) { throw new \Doctrine\ORM\EntityNotFoundException(); } foreach ($class->reflFields AS $field => $reflProperty) { $reflProperty->setValue($this, $reflProperty->getValue($original)); } unset($this->_entityPersister, $this->_identifier); } } }