PHP Class Go\Core\AspectLoader

Datei anzeigen Open project: goaop/framework Class Usage Examples

Protected Properties

Property Type Description
$annotationReader Doctrine\Common\Annotations\Reader | null Annotation reader for aspects
$container null | Go\Core\AspectContainer Aspect container instance
$loadedAspects array List of aspects that was loaded
$loaders array List of aspect loaders

Public Methods

Method Description
__construct ( Go\Core\AspectContainer $container, Doctrine\Common\Annotations\Reader $reader ) Loader constructor
getUnloadedAspects ( ) : array | Go\Aop\Aspect[] Returns list of unloaded aspects in the container
load ( Go\Aop\Aspect $aspect ) : array | Go\Aop\Pointcut[] | Go\Aop\Advisor[] Loads an aspect with the help of aspect loaders, but don't register it in the container
loadAndRegister ( Go\Aop\Aspect $aspect ) Loads and register all items of aspect in the container
registerLoaderExtension ( Go\Core\AspectLoaderExtension $loader ) Register an aspect loader extension

Protected Methods

Method Description
getAnnotations ( ReflectionClass | ReflectionMethod | ReflectionProperty $refPoint ) : array Return list of annotations for reflection point
loadFrom ( Go\Aop\Aspect $aspect, ReflectionClass | ReflectionMethod | ReflectionProperty $refPoint, array $loaders ) : array | Go\Aop\Pointcut[] | Go\Aop\Advisor[] Load definitions from specific aspect part into the aspect container

Method Details

__construct() public method

Loader constructor
public __construct ( Go\Core\AspectContainer $container, Doctrine\Common\Annotations\Reader $reader )
$container Go\Core\AspectContainer Instance of container to store pointcuts and advisors
$reader Doctrine\Common\Annotations\Reader Reader for annotations that is used for aspects

getAnnotations() protected method

Return list of annotations for reflection point
protected getAnnotations ( ReflectionClass | ReflectionMethod | ReflectionProperty $refPoint ) : array
$refPoint ReflectionClass | ReflectionMethod | ReflectionProperty Reflection instance
return array list of annotations

getUnloadedAspects() public method

Returns list of unloaded aspects in the container
public getUnloadedAspects ( ) : array | Go\Aop\Aspect[]
return array | Go\Aop\Aspect[]

load() public method

Loads an aspect with the help of aspect loaders, but don't register it in the container
See also: loadAndRegister() method for registration
public load ( Go\Aop\Aspect $aspect ) : array | Go\Aop\Pointcut[] | Go\Aop\Advisor[]
$aspect Go\Aop\Aspect Aspect to load
return array | Go\Aop\Pointcut[] | Go\Aop\Advisor[]

loadAndRegister() public method

Loads and register all items of aspect in the container
public loadAndRegister ( Go\Aop\Aspect $aspect )
$aspect Go\Aop\Aspect

loadFrom() protected method

Load definitions from specific aspect part into the aspect container
protected loadFrom ( Go\Aop\Aspect $aspect, ReflectionClass | ReflectionMethod | ReflectionProperty $refPoint, array $loaders ) : array | Go\Aop\Pointcut[] | Go\Aop\Advisor[]
$aspect Go\Aop\Aspect Aspect instance
$refPoint ReflectionClass | ReflectionMethod | ReflectionProperty Reflection instance
$loaders array List of loaders that can produce advisors from aspect class
return array | Go\Aop\Pointcut[] | Go\Aop\Advisor[]

registerLoaderExtension() public method

This method allows to extend the logic of aspect loading by registering an extension for loader.
public registerLoaderExtension ( Go\Core\AspectLoaderExtension $loader )
$loader Go\Core\AspectLoaderExtension Loader to register

Property Details

$annotationReader protected_oe property

Annotation reader for aspects
protected Reader,Doctrine\Common\Annotations|null $annotationReader
return Doctrine\Common\Annotations\Reader | null

$container protected_oe property

Aspect container instance
protected null|AspectContainer,Go\Core $container
return null | Go\Core\AspectContainer

$loadedAspects protected_oe property

List of aspects that was loaded
protected array $loadedAspects
return array

$loaders protected_oe property

List of aspect loaders
protected array $loaders
return array