Ejemplo n.º 1
0
 protected function loadMetadataFromFile(\ReflectionClass $class, $file)
 {
     $baseClassMetadata = parent::loadMetadataFromFile($class, $file);
     $classMetadata = new ClassMetadata($name = $class->getName());
     $classMetadata->merge($baseClassMetadata);
     $config = Yaml::parse(file_get_contents($file));
     $config = $config[$class->getName()];
     if (isset($config['vo_class'])) {
         $metadata->voClass = (string) $config['vo_class'];
     }
     return $metadata;
 }
Ejemplo n.º 2
0
 public function loadMetadataForClass(\ReflectionClass $class)
 {
     $baseClassMetadata = parent::loadMetadataForClass($class);
     $classMetadata = new ClassMetadata($name = $class->getName());
     $classMetadata->merge($baseClassMetadata);
     foreach ($this->reader->getClassAnnotations($class) as $annot) {
         if ($annot instanceof VOClass) {
             $classMetadata->voClass = $annot->class;
         }
     }
     return $classMetadata;
 }
Ejemplo n.º 3
0
 protected function loadMetadataFromFile(\ReflectionClass $class, $path)
 {
     $baseMetadata = parent::loadMetadataFromFile($class, $path);
     $metadata = new ClassMetadata($name = $class->getName());
     $metadata->merge($baseMetadata);
     $elem = simplexml_load_file($path);
     $elems = $elem->xpath("./class[@name = '" . $name . "']");
     $elem = reset($elems);
     if (null !== ($voClass = $elem->attributes()->{'vo-class'})) {
         $metadata->voClass = (string) $voClass;
     }
     return $metadata;
 }