Bravo3\Orm\Services\Aspect\EntityManagerInterceptorFactory::getPreRetrieve PHP Method

getPreRetrieve() protected method

protected getPreRetrieve ( ) : Closure
return Closure
    protected function getPreRetrieve()
    {
        return function ($proxy, $instance, $method, $params, &$returnEarly) {
            /** @var EntityManager $instance */
            $event = new RetrieveEvent($instance, $params['class_name'], $params['id']);
            $instance->getDispatcher()->dispatch(Event::PRE_RETRIEVE, $event);
            if ($event->getAbort()) {
                $returnEarly = true;
                return $event->getReturnValue();
            }
            return null;
        };
    }