function load($path, $args = null) { $entity = $this->Source->Type->getPersistenceObject(); if ($entity instanceof EntityObject) { foreach ($entity->Relations as $relation) { if ($relation->isLocalReference()) { $loader = new DeferredLoader($this->Source, $relation); $this->Source->{$relation->Name} = $loader->load(null); } } } return $this->Source; }
function getPropertyValue($obj, $propertyName) { if ($propertyName instanceof \Core\Type\IObject) { $propertyName = $propertyName->Oid; } if (($methodName = $this->hasGetIntercept($obj, $propertyName)) !== false) { return $obj->{$methodName}(); } if ($this->hasEvent($propertyName)) { return $this->getEvent($propertyName); } if ($this->hasPropertyRelation($obj, $propertyName) && ($this->hasPropertyData($obj, $propertyName) && !$obj->Data[$propertyName] instanceof \Core\Object || !array_key_exists($propertyName, $this->Data))) { $lazyLoader = new DeferredLoader($this, $propertyName); return $lazyLoader->load(null); } return null; }