Skip to content

Instantly share code, notes, and snippets.

@spolischook
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save spolischook/0bd36a2cacbd92b05c31 to your computer and use it in GitHub Desktop.

Select an option

Save spolischook/0bd36a2cacbd92b05c31 to your computer and use it in GitHub Desktop.
Get annotation from class
<?php
require __DIR__ . '/../vendor/autoload.php';
use Doctrine\Common\Annotations\AnnotationReader;
require __DIR__ . '/../src/Kotoblog/Annotation/Mapping.php';
$annotationReader = new AnnotationReader();
$reflectionClass = new ReflectionClass('\\Kotoblog\\Entity\\Blogpost');
foreach ($reflectionClass->getProperties() as $reflectionProperty) {
var_dump($annotationReader->getPropertyAnnotations($reflectionProperty));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment