Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function addAction(ActionInterface $action, $forcePrepend = false)
 {
     if ($action instanceof PaymentAwareInterface) {
         $action->setPayment($this);
     }
     if ($action instanceof ApiAwareInterface) {
         $apiSet = false;
         foreach ($this->apis as $api) {
             try {
                 $action->setApi($api);
                 $apiSet = true;
                 break;
             } catch (UnsupportedApiException $e) {
             }
         }
         if (false == $apiSet) {
             throw new LogicException(sprintf('Cannot find right api supported by %s', get_class($action)));
         }
     }
     $forcePrepend ? array_unshift($this->actions, $action) : array_push($this->actions, $action);
 }
Пример #2
0
 /**
  * {@inheritDoc}
  */
 public function onExecute($request, ActionInterface $action)
 {
     if ($action instanceof LoggerAwareInterface) {
         $action->setLogger($this->logger);
     }
 }