Pointcut
class Pointcut implements PointcutFilterInterface (View source)
The pointcut defines the set of join points (ie. "situations") in which certain code associated with the pointcut (ie. advices) should be executed. This set of join points is defined by a pointcut expression which is matched against class and method signatures.
Constants
MAXIMUM_RECURSIONS |
|
Properties
protected string | $pointcutExpression | A pointcut expression which configures the pointcut |
|
protected PointcutFilterComposite | $pointcutFilterComposite | The filter composite object, created from the pointcut expression |
|
protected string | $aspectClassName | If this pointcut is based on a pointcut declaration, contains the name of the aspect class where the pointcut was declared |
|
protected string | $pointcutMethodName | If this pointcut is based on a pointcut declaration, contains the name of the method acting as the pointcut identifier |
|
protected mixed | $pointcutQueryIdentifier | An identifier which is used to detect circular references between pointcuts |
|
protected int | $recursionLevel | Counts how often this pointcut's matches() method has been called during one query |
Methods
The constructor
Checks if the given class and method match this pointcut.
Returns the pointcut expression which has been passed to the constructor.
Returns the aspect class name where the pointcut was declared.
Returns the pointcut method name (if any was defined)
Returns true if this filter holds runtime evaluations for a previously matched pointcut
Returns runtime evaluations for the pointcut.
Returns the PHP code (closure) that evaluates the runtime evaluations
This method is used to optimize the matching process.
Details
__construct(string $pointcutExpression, PointcutFilterComposite $pointcutFilterComposite, string $aspectClassName, string $pointcutMethodName = null)
The constructor
bool
matches(string $className, string $methodName, string $methodDeclaringClassName, mixed $pointcutQueryIdentifier)
Checks if the given class and method match this pointcut.
Before each match run, reset() must be called to reset the circular references guard.
string
getPointcutExpression()
Returns the pointcut expression which has been passed to the constructor.
This can be used for debugging pointcuts.
string
getAspectClassName()
Returns the aspect class name where the pointcut was declared.
string
getPointcutMethodName()
Returns the pointcut method name (if any was defined)
bool
hasRuntimeEvaluationsDefinition()
Returns true if this filter holds runtime evaluations for a previously matched pointcut
array
getRuntimeEvaluationsDefinition()
Returns runtime evaluations for the pointcut.
string
getRuntimeEvaluationsClosureCode()
Returns the PHP code (closure) that evaluates the runtime evaluations
ClassNameIndex
reduceTargetClassNames(ClassNameIndex $classNameIndex)
This method is used to optimize the matching process.