/** * Dispatch an event. * * @param string $status * @param array $data Optional data to dispatch with the event. */ protected function dispatchEvent($status, array $data = []) { $name = $this->getEventNamePrefix() . '.' . $status; $event = new GenericEvent($this, $data); $this->client->getEventDispatcher()->dispatch($name, $event); }
public function __construct(HttpClient $httpClient, EventDispatcherInterface $dispatcher, Container $container) { parent::__construct($httpClient, $dispatcher); $this->container = $container; }
/** * Get projects. * * @param array $where criteria to filter projects. * @param array $order criteria to order projects. * * @return Pagerfanta */ public function getProjects(array $where = [], array $order = []) { /** @var FilterableApiInterface $api */ $api = $this->client->api('projects'); return new Pagerfanta(new PagerfantaAdapter($api, $where, $order, true, $this->classes)); }
/** * Send a DELETE request with JSON-encoded parameters. * * @param string $path Request path. * @param array $body POST parameters to be JSON encoded. * @param array $requestHeaders Request headers. * * @return \GuzzleHttp\Psr7\Stream|mixed|\Psr\Http\Message\StreamInterface */ protected function delete($path, array $body = [], $requestHeaders = []) { $response = $this->client->getHttpClient()->delete($path, $body, $requestHeaders); return ResponseMediator::getContent($response); }