Example #1
0
 /**
  * Returns the Transactional annotation for the controller.
  *
  * @param \Brick\App\RouteMatch $routeMatch
  *
  * @return Transactional|null The annotation, or NULL if the controller is not transactional.
  *
  * @todo add support for annotations on functions when Doctrine will handle them
  */
 private function getTransactionalAnnotation(RouteMatch $routeMatch)
 {
     $method = $routeMatch->getControllerReflection();
     if ($method instanceof \ReflectionMethod) {
         $annotations = $this->annotationReader->getMethodAnnotations($method);
         foreach ($annotations as $annotation) {
             if ($annotation instanceof Transactional) {
                 return $annotation;
             }
         }
     }
     return null;
 }