/** * 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; }
private function validateProxyInterface(OrmProxyInterface $proxy) { $this->assertFalse($proxy->isRelativeModified('foo')); $proxy->setRelativeModified('foo'); $this->assertTrue($proxy->isRelativeModified('foo')); }