コード例 #1
0
 /**
  * Populate this proxy by asking the $population closure.
  *
  * @return object The instance (hopefully) returned
  */
 public function _loadRealInstance()
 {
     // this check safeguards against a proxy being activated multiple times
     // usually that does not happen, but if the proxy is held from outside
     // it's parent... the result would be weird.
     if ($this->parentObject->_getProperty($this->propertyName) instanceof Tx_Extbase_Persistence_LazyLoadingProxy) {
         $objects = $this->dataMapper->fetchRelated($this->parentObject, $this->propertyName, $this->fieldValue, FALSE, FALSE);
         $propertyValue = $this->dataMapper->mapResultToPropertyValue($this->parentObject, $this->propertyName, $objects);
         $this->parentObject->_setProperty($this->propertyName, $propertyValue);
         $this->parentObject->_memorizeCleanState($this->propertyName);
         return $propertyValue;
     } else {
         return $this->parentObject->_getProperty($this->propertyName);
     }
 }