getEntityNamespace() 공개 메소드

Resolves a registered namespace alias to the full namespace.
public getEntityNamespace ( string $entityNamespaceAlias ) : string
$entityNamespaceAlias string
리턴 string
예제 #1
0
 /**
  * Gets the class metadata descriptor for a class.
  *
  * @param string $className The name of the class.
  * @return \Doctrine\OXM\Mapping\ClassMetadata
  */
 public function getMetadataFor($className)
 {
     if (!isset($this->loadedMetadata[$className])) {
         //            print_r('loading class ' . $className . "\n");
         $realClassName = $className;
         // Check for namespace alias
         if (strpos($className, ':') !== false) {
             list($namespaceAlias, $simpleClassName) = explode(':', $className);
             $realClassName = $this->configuration->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
             if (isset($this->loadedMetadata[$realClassName])) {
                 // We do not have the alias name in the map, include it
                 $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName];
                 return $this->loadedMetadata[$realClassName];
             }
         }
         if ($this->cacheDriver) {
             if (($cached = $this->cacheDriver->fetch("{$realClassName}\$XMLCLASSMETADATA")) !== false) {
                 $this->loadedMetadata[$realClassName] = $cached;
                 if (!$cached->isMappedSuperclass) {
                     $this->xmlToClassMap[$cached->getXmlName()] = $realClassName;
                 }
             } else {
                 foreach ($this->loadMetadata($realClassName) as $loadedClassName) {
                     $this->cacheDriver->save("{$loadedClassName}\$XMLCLASSMETADATA", $this->loadedMetadata[$loadedClassName], null);
                 }
             }
         } else {
             $this->loadMetadata($realClassName);
         }
         if ($className != $realClassName) {
             // We do not have the alias name in the map, include it
             $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName];
         }
     }
     return $this->loadedMetadata[$className];
 }
 /**
  * {@inheritDoc}
  */
 protected function getFqcnFromAlias($namespaceAlias, $simpleClassName)
 {
     return $this->configuration->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
 }