示例#1
0
 /**
  * Set Event
  * Event the webhook is linked to
  * @param  object $value
  * @return $this
  */
 public function setEvent($value)
 {
     if (is_object($value)) {
         $this->event = $value;
     } else {
         $obj = new Event($this->client);
         $obj->fillWithData($value);
         $this->event = $obj;
     }
     return $this;
 }
示例#2
0
 /**
  * Get all the events.
  * @param array $options
  * @return array
  */
 public function all($options = array())
 {
     $request = new Request($this->client);
     $path = "/events";
     $data = array();
     $response = $request->get($path, $data, $options);
     $returnValues = array();
     // Handling for field events
     $a = array();
     $body = $response->getBody();
     foreach ($body['events'] as $v) {
         $tmp = new Event($this->client);
         $tmp->fillWithData($v);
         $a[] = $tmp;
     }
     $returnValues['Events'] = $a;
     return array_values($returnValues)[0];
 }