Exemplo n.º 1
1
 /**
  * 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);
 }
Exemplo n.º 2
0
 public function __construct(HttpClient $httpClient, EventDispatcherInterface $dispatcher, Container $container)
 {
     parent::__construct($httpClient, $dispatcher);
     $this->container = $container;
 }
Exemplo n.º 3
0
 /**
  * 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));
 }
Exemplo n.º 4
0
 /**
  * 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);
 }