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

getPostFlush() protected method

protected getPostFlush ( ) : Closure
return Closure
    protected function getPostFlush()
    {
        return function ($proxy, $instance, $method, $params, $returnValue, &$returnEarly) {
            /** @var EntityManager $instance */
            $event = new FlushEvent($instance);
            $event->setReturnValue($instance);
            $instance->getDispatcher()->dispatch(Event::POST_FLUSH, $event);
            if ($event->getAbort()) {
                $returnEarly = true;
                return $event->getReturnValue();
            }
            return $returnValue;
        };
    }