3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
12 namespace Civi\API\Event
;
16 * @package Civi\API\Event
18 class Event
extends \Symfony\Component\EventDispatcher\Event
{
21 * @var \Civi\API\Kernel
26 * @var \Civi\API\Provider\ProviderInterface
27 * The API provider responsible for executing the request.
29 protected $apiProvider;
33 * The full description of the API request.
35 * @see \Civi\API\Request::create
37 protected $apiRequest;
40 * @param \Civi\API\Provider\ProviderInterface $apiProvider
41 * The API responsible for executing the request.
42 * @param array $apiRequest
43 * The full description of the API request.
44 * @param \Civi\API\Kernel $apiKernel
46 public function __construct($apiProvider, $apiRequest, $apiKernel) {
47 $this->apiKernel
= $apiKernel;
48 $this->apiProvider
= $apiProvider;
49 $this->apiRequest
= $apiRequest;
55 * @return \Civi\API\Kernel
57 public function getApiKernel() {
58 return $this->apiKernel
;
62 * @return \Civi\API\Provider\ProviderInterface
64 public function getApiProvider() {
65 return $this->apiProvider
;
71 public function getApiRequest() {
72 return $this->apiRequest
;
76 * Create a brief string identifying the entity/action. Useful for
77 * pithy matching/switching.
79 * Ex: if ($e->getApiRequestSig() === '3.contact.get') { ... }
84 public function getApiRequestSig() {
85 return mb_strtolower($this->apiRequest
['version'] . '.' . $this->apiRequest
['entity'] . '.' . $this->apiRequest
['action']);