TreeFixtureBehavioralCategoryProxy.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace Gedmo\Tree\Proxies;
  3. /**
  4. * THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE.
  5. */
  6. class TreeFixtureBehavioralCategoryProxy extends \Tree\Fixture\BehavioralCategory implements \Doctrine\ORM\Proxy\Proxy
  7. {
  8. private $_entityPersister;
  9. private $_identifier;
  10. public $__isInitialized__ = false;
  11. public function __construct($entityPersister, $identifier)
  12. {
  13. $this->_entityPersister = $entityPersister;
  14. $this->_identifier = $identifier;
  15. }
  16. private function _load()
  17. {
  18. if (!$this->__isInitialized__ && $this->_entityPersister) {
  19. $this->__isInitialized__ = true;
  20. if ($this->_entityPersister->load($this->_identifier, $this) === null) {
  21. throw new \Doctrine\ORM\EntityNotFoundException();
  22. }
  23. unset($this->_entityPersister, $this->_identifier);
  24. }
  25. }
  26. public function getId()
  27. {
  28. $this->_load();
  29. return parent::getId();
  30. }
  31. public function getSlug()
  32. {
  33. $this->_load();
  34. return parent::getSlug();
  35. }
  36. public function setTitle($title)
  37. {
  38. $this->_load();
  39. return parent::setTitle($title);
  40. }
  41. public function getTitle()
  42. {
  43. $this->_load();
  44. return parent::getTitle();
  45. }
  46. public function setParent(\Tree\Fixture\BehavioralCategory $parent)
  47. {
  48. $this->_load();
  49. return parent::setParent($parent);
  50. }
  51. public function getParent()
  52. {
  53. $this->_load();
  54. return parent::getParent();
  55. }
  56. public function __sleep()
  57. {
  58. return array('__isInitialized__', 'id', 'title', 'lft', 'rgt', 'parent', 'children', 'slug');
  59. }
  60. public function __clone()
  61. {
  62. if (!$this->__isInitialized__ && $this->_entityPersister) {
  63. $this->__isInitialized__ = true;
  64. $class = $this->_entityPersister->getClassMetadata();
  65. $original = $this->_entityPersister->load($this->_identifier);
  66. if ($original === null) {
  67. throw new \Doctrine\ORM\EntityNotFoundException();
  68. }
  69. foreach ($class->reflFields AS $field => $reflProperty) {
  70. $reflProperty->setValue($this, $reflProperty->getValue($original));
  71. }
  72. unset($this->_entityPersister, $this->_identifier);
  73. }
  74. }
  75. }