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

getSuffixInterceptors() public method

Get all suffix interceptors
public getSuffixInterceptors ( ) : Closure[]
return Closure[]
    public function getSuffixInterceptors()
    {
        return ['persist' => $this->getPostPersist(), 'retrieve' => $this->getPostRetrieve(), 'delete' => $this->getPostDelete(), 'flush' => $this->getPostFlush()];
    }

Usage Example

Beispiel #1
0
 /**
  * Create a new entity manager
  *
  * @param DriverInterface        $driver
  * @param MapperInterface        $mapper
  * @param SerialiserMap          $serialiser_map
  * @param KeySchemeInterface     $key_scheme
  * @param Configuration          $configuration
  * @param EntityCachingInterface $cache
  * @return EntityManager
  */
 public static function build(DriverInterface $driver, MapperInterface $mapper, SerialiserMap $serialiser_map = null, KeySchemeInterface $key_scheme = null, Configuration $configuration = null, EntityCachingInterface $cache = null)
 {
     $em_conf = $configuration ?: new Configuration();
     $proxy_conf = new \ProxyManager\Configuration();
     $proxy_conf->setProxiesTargetDir($em_conf->getCacheDir());
     $proxy_conf->setProxiesNamespace(Writer::PROXY_NAMESPACE);
     $proxy_factory = new AccessInterceptorValueHolderFactory($proxy_conf);
     $interceptor_factor = new EntityManagerInterceptorFactory();
     $em = new self($driver, $mapper, $serialiser_map, $key_scheme, $em_conf, $cache);
     $proxy = $proxy_factory->createProxy($em, $interceptor_factor->getPrefixInterceptors(), $interceptor_factor->getSuffixInterceptors());
     $em->setProxy($proxy);
     return $proxy;
 }