class JoinPoint implements JoinPointInterface (View source)

In Flow the join point object contains context information when a point cut matches and the registered advices are executed.

Properties

protected object $proxy

A reference to the proxy object

protected string $className

Class name of the target class this join point refers to

protected string $methodName

Method name of the target method which is about to or has been invoked

protected array $methodArguments

Array of method arguments which have been passed to the target method

protected AdviceChain $adviceChain

The advice chain for this join point

protected mixed $result

The result of the method invocations (only used for After Returning advices)

protected Exception $exception

The exception thrown (only used for After Throwing advices)

Methods

__construct(object $proxy, string $className, string $methodName, array $methodArguments, AdviceChain $adviceChain = null, mixed $result = null, Exception $exception = null)

Constructor, creates the join point

getProxy()

Returns the reference to the proxy class instance

string
getClassName()

Returns the class name of the target class this join point refers to

string
getMethodName()

Returns the method name of the method this join point refers to

array
getMethodArguments()

Returns an array of arguments which have been passed to the target method

mixed
getMethodArgument(string $argumentName)

Returns the value of the specified method argument

void
setMethodArgument(string $argumentName, mixed $argumentValue)

Sets the value of the specified method argument

bool
isMethodArgument(string $argumentName)

Returns true if the argument with the specified name exists in the method call this joinpoint refers to.

getAdviceChain()

Returns the advice chain related to this join point

bool
hasException()

If an exception was thrown by the target method Only makes sense for After Throwing advices.

Exception|null
getException()

Returns the exception which has been thrown in the target method.

mixed
getResult()

Returns the result of the method invocation. The result is only available for AfterReturning advices.

Details

__construct(object $proxy, string $className, string $methodName, array $methodArguments, AdviceChain $adviceChain = null, mixed $result = null, Exception $exception = null)

Constructor, creates the join point

Parameters

object $proxy

Reference to the proxy class instance of the target class

string $className

Class name of the target class this join point refers to

string $methodName

Method name of the target method which is about to or has been invoked

array $methodArguments

Array of method arguments which have been passed to the target method

AdviceChain $adviceChain

The advice chain for this join point

mixed $result

The result of the method invocations (only used for After Returning advices)

Exception $exception

The exception thrown (only used for After Throwing advices)

ProxyInterface getProxy()

Returns the reference to the proxy class instance

Return Value

ProxyInterface

string getClassName()

Returns the class name of the target class this join point refers to

Return Value

string

The class name

string getMethodName()

Returns the method name of the method this join point refers to

Return Value

string

The method name

array getMethodArguments()

Returns an array of arguments which have been passed to the target method

Return Value

array

Array of arguments

mixed getMethodArgument(string $argumentName)

Returns the value of the specified method argument

Parameters

string $argumentName

Name of the argument

Return Value

mixed

Value of the argument

Exceptions

InvalidArgumentException

void setMethodArgument(string $argumentName, mixed $argumentValue)

Sets the value of the specified method argument

Parameters

string $argumentName

Name of the argument

mixed $argumentValue

Value of the argument

Return Value

void

Exceptions

InvalidArgumentException

bool isMethodArgument(string $argumentName)

Returns true if the argument with the specified name exists in the method call this joinpoint refers to.

Parameters

string $argumentName

Name of the argument to check

Return Value

bool

true if the argument exists

AdviceChain getAdviceChain()

Returns the advice chain related to this join point

Return Value

AdviceChain

The advice chain

bool hasException()

If an exception was thrown by the target method Only makes sense for After Throwing advices.

Return Value

bool

Exception|null getException()

Returns the exception which has been thrown in the target method.

If no exception has been thrown, NULL is returned. Only makes sense for After Throwing advices.

Return Value

Exception|null

The exception thrown or NULL

mixed getResult()

Returns the result of the method invocation. The result is only available for AfterReturning advices.

Return Value

mixed

Result of the method invocation