class AspectContainer (View source)

An aspect is represented by class tagged with the "aspect" annotation.

The aspect class may contain advices and pointcut declarations. Aspect classes are wrapped by this Aspect Container.

For each advice a pointcut expression (not declaration!) is required to define when an advice should apply. The combination of advice and pointcut expression is called "advisor".

A pointcut declaration only contains a pointcut expression and is used to make pointcut expressions reusable and combinable.

An introduction declaration on the class level contains an interface name and a pointcut expression and is used to introduce a new interface to the target class.

If used on a property an introduction contains a pointcut expression and is used to introduce the annotated property into the target class.

Properties

protected string $className
protected array $advisors

An array of \Neos\Flow\Aop\Advisor objects

protected array $interfaceIntroductions

An array of \Neos\Flow\Aop\InterfaceIntroduction objects

protected array $propertyIntroductions

An array of \Neos\Flow\Aop\PropertyIntroduction objects

protected array $traitIntroductions

An array of \Neos\Flow\Aop\TraitIntroduction objects

protected array $pointcuts

An array of explicitly declared \Neos\Flow\Pointcut objects

protected ClassNameIndex $cachedTargetClassNameCandidates

Methods

__construct(string $className)

The constructor

string
getClassName()

Returns the name of the aspect class

array
getAdvisors()

Returns the advisors which were defined in the aspect

array
getInterfaceIntroductions()

Returns the interface introductions which were defined in the aspect

array
getPropertyIntroductions()

Returns the property introductions which were defined in the aspect

array
getTraitIntroductions()

Returns the trait introductions which were defined in the aspect

array
getPointcuts()

Returns the pointcuts which were declared in the aspect. This does not contain the pointcuts which were made out of the pointcut expressions for the advisors!

void
addAdvisor(Advisor $advisor)

Adds an advisor to this aspect container

void
addInterfaceIntroduction(InterfaceIntroduction $introduction)

Adds an introduction declaration to this aspect container

void
addPropertyIntroduction(PropertyIntroduction $introduction)

Adds an introduction declaration to this aspect container

void
addTraitIntroduction(TraitIntroduction $introduction)

Adds an introduction declaration to this aspect container

void
addPointcut(Pointcut $pointcut)

Adds a pointcut (from a pointcut declaration) to this aspect container

reduceTargetClassNames(ClassNameIndex $classNameIndex)

This method is used to optimize the matching process.

Details

__construct(string $className)

The constructor

Parameters

string $className

Name of the aspect class

string getClassName()

Returns the name of the aspect class

Return Value

string

Name of the aspect class

array getAdvisors()

Returns the advisors which were defined in the aspect

Return Value

array

Array of \Neos\Flow\Aop\Advisor objects

array getInterfaceIntroductions()

Returns the interface introductions which were defined in the aspect

Return Value

array

Array of \Neos\Flow\Aop\InterfaceIntroduction objects

array getPropertyIntroductions()

Returns the property introductions which were defined in the aspect

Return Value

array

Array of \Neos\Flow\Aop\PropertyIntroduction objects

array getTraitIntroductions()

Returns the trait introductions which were defined in the aspect

Return Value

array

Array of \Neos\Flow\Aop\TraitIntroduction objects

array getPointcuts()

Returns the pointcuts which were declared in the aspect. This does not contain the pointcuts which were made out of the pointcut expressions for the advisors!

Return Value

array

Array of \Neos\Flow\Aop\Pointcut\Pointcut objects

void addAdvisor(Advisor $advisor)

Adds an advisor to this aspect container

Parameters

Advisor $advisor

The advisor to add

Return Value

void

void addInterfaceIntroduction(InterfaceIntroduction $introduction)

Adds an introduction declaration to this aspect container

Parameters

InterfaceIntroduction $introduction

Return Value

void

void addPropertyIntroduction(PropertyIntroduction $introduction)

Adds an introduction declaration to this aspect container

Parameters

PropertyIntroduction $introduction

Return Value

void

void addTraitIntroduction(TraitIntroduction $introduction)

Adds an introduction declaration to this aspect container

Parameters

TraitIntroduction $introduction

Return Value

void

void addPointcut(Pointcut $pointcut)

Adds a pointcut (from a pointcut declaration) to this aspect container

Parameters

Pointcut $pointcut

The pointcut to add

Return Value

void

ClassNameIndex reduceTargetClassNames(ClassNameIndex $classNameIndex)

This method is used to optimize the matching process.

Parameters

ClassNameIndex $classNameIndex

Return Value

ClassNameIndex

ClassNameIndex getCachedTargetClassNameCandidates()

No description

Return Value

ClassNameIndex