Example #1
0
 public function postProcessAfterInitialization($instance, $className)
 {
     /** @var \A7\Annotations\Transactional $transactional */
     $transactional = $this->annotationManager->getClassAnnotation($className, 'Transactional');
     if (isset($transactional) && $transactional->isEnabled()) {
         if (!$instance instanceof Proxy) {
             $instance = new Proxy($this->a7, $className, $instance);
         }
         $instance->a7AddBeforeCall([$this, 'beginTransaction']);
         $instance->a7AddAfterCall([$this, 'commit']);
         $instance->a7AddExceptionHandling([$this, 'rollback']);
     }
     return $instance;
 }
Example #2
0
 function postProcessAfterInitialization($instance, $className)
 {
     if (!$instance instanceof Proxy) {
         $instance = new Proxy($this->a7, $className, $instance);
     }
     $ab = true;
     if (isset($this->parameters['classPath'])) {
         $ab = strpos($className, $this->parameters['classPath']) === 0;
     }
     if ($ab) {
         $instance->a7AddBeforeCall([$this, 'beforeCall']);
         $instance->a7AddAfterCall([$this, 'afterCall']);
     }
     $instance->a7AddExceptionHandling([$this, 'exceptionHandling']);
     return $instance;
 }