private function getPropertiesByType($entity, $type)
    {
        $properties = $this->readClassProperties($entity);

        $fields = [];
        foreach ($properties as $property) {
            $annotation = $this->reader->getPropertyAnnotation($property, $type);

            if (null === $annotation) {
                continue;
            }

            $property->setAccessible(true);
            $annotation->value = $property->getValue($entity);
            $annotation->name = $property->getName();

            $fields[] = $annotation;
        }

        return $fields;
    }
private function getPropertiesByType($entity, $type)
    {
        $properties = $this->readClassProperties($entity);

        $fields = [];
        foreach ($properties as $property) {
            $annotation = $this->reader->getPropertyAnnotation($property, $type);

            if (null === $annotation) {
                continue;
            }

            $property->setAccessible(true);
            $annotation->value = $property->getValue($entity);
            $annotation->name = $property->getName();

            $fields[] = $annotation;
        }

        return $fields;
    }
private function getPropertiesByType ( $ entity , $ type ) { $ properties = $ this -> readClassProperties ( $ entity ) ; $ fields = [ ] ; foreach ( $ properties as $ property ) { $ annotation = $ this -> reader -> getPropertyAnnotation ( $ property , $ type ) ; if ( null === $ annotation ) { continue ; } $ property -> setAccessible ( true ) ; $ annotation -> value = $ property -> getValue ( $ entity ) ; $ annotation -> name = $ property -> getName ( ) ; $ fields [ ] = $ annotation ; } return $ fields ; }
reads the entity and returns a set of annotations

@param object $entity
@param string $type

@return Annotation[]
reads the entity and returns a set of annotations