Loads the metadata of the class in question and all it's ancestors whose metadata is still not loaded.
string $name The name of the class for which the metadata should get loaded.:
array
protected function loadMetadata($name) {
if (!$this->initialized) {
$this
->initialize();
}
$loaded = array();
$parentClasses = $this
->getParentClasses($name);
$parentClasses[] = $name;
// Move down the hierarchy of parent classes, starting from the topmost class
$parent = null;
$rootEntityFound = false;
$visited = array();
$reflService = $this
->getReflectionService();
foreach ($parentClasses as $className) {
if (isset($this->loadedMetadata[$className])) {
$parent = $this->loadedMetadata[$className];
if ($this
->isEntity($parent)) {
$rootEntityFound = true;
array_unshift($visited, $className);
}
continue;
}
$class = $this
->newClassMetadataInstance($className);
$this
->initializeReflection($class, $reflService);
$this
->doLoadMetadata($class, $parent, $rootEntityFound, $visited);
$this->loadedMetadata[$className] = $class;
$parent = $class;
if ($this
->isEntity($class)) {
$rootEntityFound = true;
array_unshift($visited, $className);
}
$this
->wakeupReflection($class, $reflService);
$loaded[] = $className;
}
return $loaded;
}