/**
* Before advice, making sure we initialize before use.
*
* This expects $proxy->Flow_Persistence_LazyLoadingObject_thawProperties
* to be a Closure that populates the object. That variable is unset after
* initializing the object!
*
* @param JoinPointInterface $joinPoint The current join point
* @return void
* @Flow\Before("Neos\Flow\Persistence\Generic\Aspect\LazyLoadingObjectAspect->needsLazyLoadingObjectAspect && !method(.*->__construct())")
*/
public function initialize(JoinPointInterface $joinPoint)
{
$proxy = $joinPoint->getProxy();
if (property_exists($proxy, 'Flow_Persistence_LazyLoadingObject_thawProperties') && $proxy->Flow_Persistence_LazyLoadingObject_thawProperties instanceof \Closure) {
$proxy->Flow_Persistence_LazyLoadingObject_thawProperties->__invoke($proxy);
unset($proxy->Flow_Persistence_LazyLoadingObject_thawProperties);
}
}