Right, get a little deeper into how the Doctrine does it, and I think I know how to do it. Therefore, if someone else needs to do it here, how I do it (we will be grateful for any feedback)
, , config.yml annotation_reader, .
, Doctrine, , Foo , - :
namespace MyBundleName
class Foo extends \Doctrine\Common\Annotations\Annotation {
}
, :
$class = get_class($object);
foreach(object_get_vars($object) as $fieldname => $val){
$annotations = $this->annotationReader
->getPropertyAnnotations(
new \ReflectionProperty($class, $fieldName)
);
}
, - !