Example #1
0
 private function loadPropertyAnnotations(\ReflectionClass $class, ClassMetadata $metadata)
 {
     $loaded = false;
     foreach ($class->getProperties() as $property) {
         $fabriciusAnnotation = null;
         foreach ($this->reader->getPropertyAnnotations($property) as $annot) {
             $loaded = true;
             if ($annot instanceof Parameter) {
                 if ($fabriciusAnnotation) {
                     throw new MappingException('More than one Fabricius-related annotation found.');
                 }
                 $fabriciusAnnotation = $annot;
             }
             $metadata->addPropertyConstraint($property->getName(), $annot);
         }
         if ($fabriciusAnnotation) {
             $metadata->addPropertyConstraint($property->getName(), $annot);
         }
     }
     return $loaded;
 }