Advertisement
Puzo

Doctrine inserting error - File modelsLanguagesProxy.php

Nov 2nd, 2011
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.65 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Proxies;
  4.  
  5. /**
  6.  * THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE.
  7.  */
  8. class modelsLanguagesProxy extends \models\Languages implements \Doctrine\ORM\Proxy\Proxy
  9. {
  10.     private $_entityPersister;
  11.     private $_identifier;
  12.     public $__isInitialized__ = false;
  13.     public function __construct($entityPersister, $identifier)
  14.     {
  15.         $this->_entityPersister = $entityPersister;
  16.         $this->_identifier = $identifier;
  17.     }
  18.     /** @private */
  19.     public function __load()
  20.     {
  21.         if (!$this->__isInitialized__ && $this->_entityPersister) {
  22.             $this->__isInitialized__ = true;
  23.  
  24.             if (method_exists($this, "__wakeup")) {
  25.                 // call this after __isInitialized__to avoid infinite recursion
  26.                 // but before loading to emulate what ClassMetadata::newInstance()
  27.                 // provides.
  28.                 $this->__wakeup();
  29.             }
  30.  
  31.             if ($this->_entityPersister->load($this->_identifier, $this) === null) {
  32.                 throw new \Doctrine\ORM\EntityNotFoundException();
  33.             }
  34.             unset($this->_entityPersister, $this->_identifier);
  35.         }
  36.     }
  37.    
  38.    
  39.     public function setIcon($icon)
  40.     {
  41.         $this->__load();
  42.         return parent::setIcon($icon);
  43.     }
  44.  
  45.     public function getIcon()
  46.     {
  47.         $this->__load();
  48.         return parent::getIcon();
  49.     }
  50.  
  51.     public function setSlug($slug)
  52.     {
  53.         $this->__load();
  54.         return parent::setSlug($slug);
  55.     }
  56.  
  57.     public function getSlug()
  58.     {
  59.         $this->__load();
  60.         return parent::getSlug();
  61.     }
  62.  
  63.     public function setTitle($title)
  64.     {
  65.         $this->__load();
  66.         return parent::setTitle($title);
  67.     }
  68.  
  69.     public function getTitle()
  70.     {
  71.         $this->__load();
  72.         return parent::getTitle();
  73.     }
  74.  
  75.  
  76.     public function __sleep()
  77.     {
  78.         return array('__isInitialized__', 'id', 'title', 'slug', 'icon');
  79.     }
  80.  
  81.     public function __clone()
  82.     {
  83.         if (!$this->__isInitialized__ && $this->_entityPersister) {
  84.             $this->__isInitialized__ = true;
  85.             $class = $this->_entityPersister->getClassMetadata();
  86.             $original = $this->_entityPersister->load($this->_identifier);
  87.             if ($original === null) {
  88.                 throw new \Doctrine\ORM\EntityNotFoundException();
  89.             }
  90.             foreach ($class->reflFields AS $field => $reflProperty) {
  91.                 $reflProperty->setValue($this, $reflProperty->getValue($original));
  92.             }
  93.             unset($this->_entityPersister, $this->_identifier);
  94.         }
  95.        
  96.     }
  97. }
  98.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement