AnnotationReader
in package
FinalYes
Annotation reader for controller methods.
Reads and parses Doctrine annotations from controller methods to extract access control information.
Usage:
$access = AnnotationReader::getAccessibility('UserController', 'edit');
if (!$access->allow_logoff) {
redirect('/login');
}
Table of Contents
Methods
- getAccessibility() : mixed
- Get Access annotation information from a controller method.
- getMethodAnnotation() : object|null
- Get a specific annotation from a method.
- reader() : AnnotationReader
- Get singleton Doctrine AnnotationReader instance.
Methods
getAccessibility()
Get Access annotation information from a controller method.
public
static getAccessibility(string $class, string $method) : mixed
Returns the access control settings defined by @Access annotation. If no annotation is found, returns default Access values (all allowed).
Parameters
- $class : string
-
Controller class name (without namespace).
- $method : string
-
Method name.
Return values
mixed —Access settings.
getMethodAnnotation()
Get a specific annotation from a method.
private
static getMethodAnnotation(string $class, string $method, string $annotationName) : object|null
Parameters
- $class : string
-
Controller class name.
- $method : string
-
Method name.
- $annotationName : string
-
Annotation class short name (e.g., "Access").
Return values
object|null —Annotation object or null if not found.
reader()
Get singleton Doctrine AnnotationReader instance.
private
static reader() : AnnotationReader
Return values
AnnotationReader —Cached reader instance.