library/DoctrineEntityReader/EntityReader.php
protected static function createProperty(\ReflectionProperty $reflectionProperty)
    {
        $property = new Property();
        $property->setName($reflectionProperty->getName());
        
        $annotationReader = new AnnotationReader();
        $annotations = $annotationReader->getPropertyAnnotations($reflectionProperty);
        foreach ($annotations as $annotation) {
            $annotationClassName = get_class($annotation);
            if ($annotationClassName == 'Doctrine\ORM\Mapping\Column' || $annotationClassName == 'Doctrine\ORM\Mapping\Id') {
                $property->setAnnotation($annotation);
                $property->setType(Property::PROPERTY_TYPE_COLUMN);
            } elseif ($annotationClassName == 'Doctrine\ORM\Mapping\ManyToOne' || $annotationClassName == 'Doctrine\ORM\Mapping\OneToOne') {
                $property->setAnnotation($annotation);
                $property->setType(Property::PROPERTY_TYPE_REF_ONE);
                $property->setTargetEntity($annotation->targetEntity);
            } elseif ($annotationClassName == 'Doctrine\ORM\Mapping\ManyToMany' || $annotationClassName == 'Doctrine\ORM\Mapping\OneToMany') {
                $property->setAnnotation($annotation);
                $property->setType(Property::PROPERTY_TYPE_REF_MANY);
                $property->setTargetEntity($annotation->targetEntity);
            }
        }
        
        if ($property->getType() == -1) {
            throw new \Exception(
                'Entity "' . $reflectionProperty->getDeclaringClass()->getName()
                . '": defining annotation is missing at property "' . $property->getName() . '"!'
            );
        }
        
        return $property;
    }
protected static function createProperty(\ReflectionProperty $reflectionProperty)
    {
        $property = new Property();
        $property->setName($reflectionProperty->getName());
        
        $annotationReader = new AnnotationReader();
        $annotations = $annotationReader->getPropertyAnnotations($reflectionProperty);
        foreach ($annotations as $annotation) {
            $annotationClassName = get_class($annotation);
            if ($annotationClassName == 'Doctrine\ORM\Mapping\Column' || $annotationClassName == 'Doctrine\ORM\Mapping\Id') {
                $property->setAnnotation($annotation);
                $property->setType(Property::PROPERTY_TYPE_COLUMN);
            } elseif ($annotationClassName == 'Doctrine\ORM\Mapping\ManyToOne' || $annotationClassName == 'Doctrine\ORM\Mapping\OneToOne') {
                $property->setAnnotation($annotation);
                $property->setType(Property::PROPERTY_TYPE_REF_ONE);
                $property->setTargetEntity($annotation->targetEntity);
            } elseif ($annotationClassName == 'Doctrine\ORM\Mapping\ManyToMany' || $annotationClassName == 'Doctrine\ORM\Mapping\OneToMany') {
                $property->setAnnotation($annotation);
                $property->setType(Property::PROPERTY_TYPE_REF_MANY);
                $property->setTargetEntity($annotation->targetEntity);
            }
        }
        
        if ($property->getType() == -1) {
            throw new \Exception(
                'Entity "' . $reflectionProperty->getDeclaringClass()->getName()
                . '": defining annotation is missing at property "' . $property->getName() . '"!'
            );
        }
        
        return $property;
    }
protected static function createProperty ( \ ReflectionProperty $ reflectionProperty ) { $ property = new Property ( ) ; $ property -> setName ( $ reflectionProperty -> getName ( ) ) ; $ annotationReader = new AnnotationReader ( ) ; $ annotations = $ annotationReader -> getPropertyAnnotations ( $ reflectionProperty ) ; foreach ( $ annotations as $ annotation ) { $ annotationClassName = get_class ( $ annotation ) ; if ( $ annotationClassName == 'Doctrine\ORM\Mapping\Column' || $ annotationClassName == 'Doctrine\ORM\Mapping\Id' ) { $ property -> setAnnotation ( $ annotation ) ; $ property -> setType ( Property :: PROPERTY_TYPE_COLUMN ) ; } elseif ( $ annotationClassName == 'Doctrine\ORM\Mapping\ManyToOne' || $ annotationClassName == 'Doctrine\ORM\Mapping\OneToOne' ) { $ property -> setAnnotation ( $ annotation ) ; $ property -> setType ( Property :: PROPERTY_TYPE_REF_ONE ) ; $ property -> setTargetEntity ( $ annotation -> targetEntity ) ; } elseif ( $ annotationClassName == 'Doctrine\ORM\Mapping\ManyToMany' || $ annotationClassName == 'Doctrine\ORM\Mapping\OneToMany' ) { $ property -> setAnnotation ( $ annotation ) ; $ property -> setType ( Property :: PROPERTY_TYPE_REF_MANY ) ; $ property -> setTargetEntity ( $ annotation -> targetEntity ) ; } } if ( $ property -> getType ( ) == - 1 ) { throw new \ Exception ( 'Entity "' . $ reflectionProperty -> getDeclaringClass ( ) -> getName ( ) . '": defining annotation is missing at property "' . $ property -> getName ( ) . '"!' ) ; } return $ property ; }
Returns created Property-Object
gets Information from Reflection-Property which contains Doctrine-Annotations

@param \ReflectionProperty $reflectionProperty Reflection-Property of Entity

@throws \Exception
@return boolean|\DoctrineEntityReader\Property
Returns created Property - Object gets Information from Reflection - Property which contains Doctrine - Annotations