Created
January 9, 2013 22:06
-
-
Save AlexTiTanium/4497419 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace ODM\Proxies\__CG__\Documents\Shop; | |
use Doctrine\ODM\MongoDB\Persisters\DocumentPersister; | |
/** | |
* THIS CLASS WAS GENERATED BY THE DOCTRINE ODM. DO NOT EDIT THIS FILE. | |
*/ | |
class Catalog extends \Documents\Shop\Catalog implements \Doctrine\ODM\MongoDB\Proxy\Proxy | |
{ | |
private $__documentPersister__; | |
public $__identifier__; | |
public $__isInitialized__ = false; | |
public function __construct(DocumentPersister $documentPersister, $identifier) | |
{ | |
$this->__documentPersister__ = $documentPersister; | |
$this->__identifier__ = $identifier; | |
} | |
/** @private */ | |
public function __load() | |
{ | |
if (!$this->__isInitialized__ && $this->__documentPersister__) { | |
$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->__documentPersister__->load($this->__identifier__, $this) === null) { | |
throw \Doctrine\ODM\MongoDB\DocumentNotFoundException::documentNotFound(get_class($this), $this->__identifier__); | |
} | |
unset($this->__documentPersister__, $this->__identifier__); | |
} | |
} | |
/** @private */ | |
public function __isInitialized() | |
{ | |
return $this->__isInitialized__; | |
} | |
public function getId() | |
{ | |
if ($this->__isInitialized__ === false) { | |
return $this->__identifier__; | |
} | |
$this->__load(); | |
return parent::getId(); | |
} | |
public function setNodeId($nodeId) | |
{ | |
$this->__load(); | |
return parent::setNodeId($nodeId); | |
} | |
public function getNodeId() | |
{ | |
$this->__load(); | |
return parent::getNodeId(); | |
} | |
public function setName($name) | |
{ | |
$this->__load(); | |
return parent::setName($name); | |
} | |
public function getName() | |
{ | |
$this->__load(); | |
return parent::getName(); | |
} | |
public function setType($type) | |
{ | |
$this->__load(); | |
return parent::setType($type); | |
} | |
public function getType() | |
{ | |
$this->__load(); | |
return parent::getType(); | |
} | |
public function setIndex($index) | |
{ | |
$this->__load(); | |
return parent::setIndex($index); | |
} | |
public function getIndex() | |
{ | |
$this->__load(); | |
return parent::getIndex(); | |
} | |
public function setAncestors($ancestors) | |
{ | |
$this->__load(); | |
return parent::setAncestors($ancestors); | |
} | |
public function getAncestors() | |
{ | |
$this->__load(); | |
return parent::getAncestors(); | |
} | |
public function toArray() | |
{ | |
$this->__load(); | |
return parent::toArray(); | |
} | |
public function toFlatArray($removeFromResult = false) | |
{ | |
$this->__load(); | |
return parent::toFlatArray($removeFromResult); | |
} | |
public function __sleep() | |
{ | |
return array('__isInitialized__', 'id', 'nodeId', 'name', 'type', 'index', 'ancestors'); | |
} | |
public function __clone() | |
{ | |
if (!$this->__isInitialized__ && $this->__documentPersister__) { | |
$this->__isInitialized__ = true; | |
$class = $this->__documentPersister__->getClassMetadata(); | |
$original = $this->__documentPersister__->load($this->__identifier__); | |
if ($original === null) { | |
throw \Doctrine\ODM\MongoDB\MongoDBException::documentNotFound(get_class($this), $this->__identifier__); | |
} | |
foreach ($class->reflFields AS $field => $reflProperty) { | |
$reflProperty->setValue($this, $reflProperty->getValue($original)); | |
} | |
unset($this->__documentPersister__, $this->__identifier__); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment