Doctrine\ODM\OrientDB\Mapper\ClassMetadata::getReflectionClass PHP Метод

getReflectionClass() публичный Метод

Gets the ReflectionClass instance for this mapped class.
public getReflectionClass ( ) : ReflectionClass
Результат ReflectionClass
    public function getReflectionClass()
    {
        if (!$this->refClass) {
            $this->refClass = new \ReflectionClass($this->getName());
        }
        return $this->refClass;
    }

Usage Example

 protected function populateMetadata(ClassMetadata $metadata)
 {
     $associations = array();
     $fields = array();
     $foundIdentifier = false;
     foreach ($metadata->getReflectionClass()->getProperties() as $refProperty) {
         $annotation = $this->getPropertyAnnotation($refProperty);
         if ($annotation) {
             if ('@rid' === $annotation->name) {
                 $foundIdentifier = true;
                 $metadata->setIdentifier($refProperty->getName());
                 $fields[$refProperty->getName()] = $annotation;
             } elseif (in_array($annotation->type, $this->getAssociationTypes())) {
                 $associations[$refProperty->getName()] = $annotation;
             } else {
                 $fields[$refProperty->getName()] = $annotation;
             }
         }
     }
     if (!$foundIdentifier) {
         throw MappingException::missingRid($metadata->getName());
     }
     $metadata->setFields($fields);
     $metadata->setAssociations($associations);
     return $associations;
 }