Inheritance: extends ProxyManager\Proxy\LazyLoadingInterface
コード例 #1
0
ファイル: Writer.php プロジェクト: bravo3/orm
 /**
  * Check if $method refers to a related entity, if it does then use the EntityManager to hydrate that entity
  *
  * @param string $method
  * @return $this
  */
 private function examineMethodForHydration($method)
 {
     $property = $this->metadata->getPropertyFor($method);
     if ($property) {
         $relative = $this->metadata->getRelationshipByName($property);
         if ($relative) {
             if ($relative->getSetter() == $method) {
                 $this->proxy->setRelativeModified($property);
                 $this->hydrated_methods[$method] = true;
                 $this->hydrated_methods[$relative->getGetter()] = true;
             } elseif ($relative->getGetter() == $method) {
                 if (!isset($this->hydrated_methods[$method])) {
                     $this->hydrateRelative($relative);
                     $this->hydrated_methods[$method] = true;
                     $this->hydrated_methods[$relative->getSetter()] = true;
                 }
             }
         }
     }
     return $this;
 }
コード例 #2
0
ファイル: EntityManagerTest.php プロジェクト: bravo3/orm
 private function validateProxyInterface(OrmProxyInterface $proxy)
 {
     $this->assertFalse($proxy->isRelativeModified('foo'));
     $proxy->setRelativeModified('foo');
     $this->assertTrue($proxy->isRelativeModified('foo'));
 }