/** * {@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); }
/** * {@inheritDoc} */ public function onExecute($request, ActionInterface $action) { if ($action instanceof LoggerAwareInterface) { $action->setLogger($this->logger); } }