class LazyLoadingAspect (View source)

Adds the aspect of lazy loading to objects with scope session.

Properties

protected ObjectManagerInterface $objectManager
protected SessionManagerInterface $sessionManager
protected LoggerInterface $logger
protected array $sessionOriginalInstances

Methods

void
injectLogger(LoggerInterface $logger)

Injects the (system) logger based on PSR-3.

void
registerSessionInstance(string $objectName, object $object)

Registers an object of scope session.

void
initializeSession(JoinPointInterface $joinPoint)

Before advice for all methods annotated with "@Flow\Session(autoStart=true)".

mixed
callMethodOnOriginalSessionObject(JoinPointInterface $joinPoint)

Around advice, wrapping every method of a scope session object. It redirects all method calls to the session object once there is one.

Details

void injectLogger(LoggerInterface $logger)

Injects the (system) logger based on PSR-3.

Parameters

LoggerInterface $logger

Return Value

void

void registerSessionInstance(string $objectName, object $object)

Registers an object of scope session.

Parameters

string $objectName
object $object

Return Value

void

See also

ObjectManager

void initializeSession(JoinPointInterface $joinPoint)

Before advice for all methods annotated with "@Flow\Session(autoStart=true)".

Those methods will trigger a session initialization if a session does not exist yet.

Parameters

JoinPointInterface $joinPoint

The current join point

Return Value

void

mixed callMethodOnOriginalSessionObject(JoinPointInterface $joinPoint)

Around advice, wrapping every method of a scope session object. It redirects all method calls to the session object once there is one.

Parameters

JoinPointInterface $joinPoint

The current join point

Return Value

mixed