X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FAPI%2FKernel.php;h=9f224965fd22c6ae6bcdbbbf91108525e442aec3;hb=f38178e6aa43297ef8b9e08ca1bcb6bd49c81473;hp=663812ffafa93e04e4f6ed701c635ac8c4cf68c0;hpb=b71cb96619f284fb007d4365c33f59f088573d8f;p=civicrm-core.git diff --git a/Civi/API/Kernel.php b/Civi/API/Kernel.php index 663812ffaf..9f224965fd 100644 --- a/Civi/API/Kernel.php +++ b/Civi/API/Kernel.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.6 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2014 | + | Copyright CiviCRM LLC (c) 2004-2015 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -35,7 +35,7 @@ use Civi\API\Provider\ProviderInterface; /** * @package Civi - * @copyright CiviCRM LLC (c) 2004-2014 + * @copyright CiviCRM LLC (c) 2004-2015 */ class Kernel { @@ -99,7 +99,7 @@ class Kernel { return $this->formatResult($apiRequest, $apiResponse); } catch (\Exception $e) { - $this->dispatcher->dispatch(Events::EXCEPTION, new ExceptionEvent($e, $apiProvider, $apiRequest)); + $this->dispatcher->dispatch(Events::EXCEPTION, new ExceptionEvent($e, $apiProvider, $apiRequest, $this)); if ($e instanceof \PEAR_Exception) { $err = $this->formatPearException($e, $apiRequest); @@ -165,7 +165,7 @@ class Kernel { */ public function resolve($apiRequest) { /** @var ResolveEvent $resolveEvent */ - $resolveEvent = $this->dispatcher->dispatch(Events::RESOLVE, new ResolveEvent($apiRequest)); + $resolveEvent = $this->dispatcher->dispatch(Events::RESOLVE, new ResolveEvent($apiRequest, $this)); $apiRequest = $resolveEvent->getApiRequest(); if (!$resolveEvent->getApiProvider()) { throw new \Civi\API\Exception\NotImplementedException("API (" . $apiRequest['entity'] . ", " . $apiRequest['action'] . ") does not exist (join the API team and implement it!)"); @@ -184,7 +184,7 @@ class Kernel { */ public function authorize($apiProvider, $apiRequest) { /** @var AuthorizeEvent $event */ - $event = $this->dispatcher->dispatch(Events::AUTHORIZE, new AuthorizeEvent($apiProvider, $apiRequest)); + $event = $this->dispatcher->dispatch(Events::AUTHORIZE, new AuthorizeEvent($apiProvider, $apiRequest, $this)); if (!$event->isAuthorized()) { throw new \Civi\API\Exception\UnauthorizedException("Authorization failed"); } @@ -201,7 +201,7 @@ class Kernel { */ public function prepare($apiProvider, $apiRequest) { /** @var PrepareEvent $event */ - $event = $this->dispatcher->dispatch(Events::PREPARE, new PrepareEvent($apiProvider, $apiRequest)); + $event = $this->dispatcher->dispatch(Events::PREPARE, new PrepareEvent($apiProvider, $apiRequest, $this)); return $event->getApiRequest(); } @@ -218,7 +218,7 @@ class Kernel { */ public function respond($apiProvider, $apiRequest, $result) { /** @var RespondEvent $event */ - $event = $this->dispatcher->dispatch(Events::RESPOND, new RespondEvent($apiProvider, $apiRequest, $result)); + $event = $this->dispatcher->dispatch(Events::RESPOND, new RespondEvent($apiProvider, $apiRequest, $result, $this)); return $event->getResponse(); }