Ejemplo n.º 1
0
 /**
  * Loads the metadata of the class in question and all it's ancestors whose metadata
  * is still not loaded.
  *
  * @param string $className The name of the class for which the metadata should get loaded.
  */
 private function loadMetadata($name)
 {
     if (!class_exists($name)) {
         throw MappingException::classNotFound($name);
     }
     $parentClasses = $this->getParentClasses($name);
     $parentClasses[] = $name;
     $loaded = array();
     $parent = null;
     /* @var $parent ClassMetadata */
     foreach ($parentClasses as $className) {
         if (isset($this->loadedMetadata[$className])) {
             $parent = $this->loadedMetadata[$className];
             continue;
         }
         // original class was checked above already
         if ($className != $name && !class_exists($className)) {
             throw MappingException::classNotFound($className);
         }
         if ($parent) {
             $class = $parent->deriveChildMetadata($className);
         } else {
             $class = new ClassMetadata($className);
         }
         $this->loadedMetadata[$className] = $class;
         $this->driver->loadMetadataForClass($className, $this->loadedMetadata[$className]);
         $parent = $class;
         $loaded[] = $className;
     }
     return $loaded;
 }
Ejemplo n.º 2
0
 /**
  * Whether the class with the specified name should have its metadata loaded.
  * This is only the case if it is either mapped as an Entity or a
  * MappedSuperclass.
  *
  * @param string $className
  * @return boolean
  */
 public function isTransient($className)
 {
     return $this->driver->isTransient($className);
 }