Documentation

AnnotationReader
in package

FinalYes

Read the annotations of the controller's methods.

Table of Contents

Methods

getAccessibility()  : array{allow_login: bool, allow_logoff: bool, allow_role: string, allow_http: bool}
Get Access annotation information.
getMethodAnnotation()  : object|null
Get method annotation.
reader()  : AnnotationReader
Get AnnotationReader instance.

Methods

getAccessibility()

Get Access annotation information.

public static getAccessibility(string $class, string $method) : array{allow_login: bool, allow_logoff: bool, allow_role: string, allow_http: bool}

The Access annotation contains the following fields.

  • allow_login: Set to true to allow access for logged-in users or false to disallow access.
  • allow_logoff: Set to true to allow access for logoff users, or false to disallow access.
  • allow_role: Role names of logged-in users to be allowed access. You can specify multiple comma-separated names.
  • allow_http: Set to true to allow access from HTTP, false to disallow. For example, if you want to allow access only from the CLI, set false.
Parameters
$class : string

Controller class name.

$method : string

Method name.

Return values
array{allow_login: bool, allow_logoff: bool, allow_role: string, allow_http: bool}

Access annotation object.

getMethodAnnotation()

Get method annotation.

private static getMethodAnnotation(string $class, string $method, string $annotationName) : object|null
Parameters
$class : string

Controller class name.

$method : string

Method name.

$annotationName : string

Annotation Name.

Return values
object|null

Method annotation object.

reader()

Get AnnotationReader instance.

private static reader() : AnnotationReader
Return values
AnnotationReader

AnnotationReader instance.


        
On this page

Search results