예제 #1
0
 /**
  * Set Subscription
  * Subscription to which the invoice is linked to, if any
  * @param  object $value
  * @return $this
  */
 public function setSubscription($value)
 {
     if (is_object($value)) {
         $this->subscription = $value;
     } else {
         $obj = new Subscription($this->client);
         $obj->fillWithData($value);
         $this->subscription = $obj;
     }
     return $this;
 }
예제 #2
0
 /**
  * Get all the subscriptions.
  * @param array $options
  * @return array
  */
 public function all($options = array())
 {
     $request = new Request($this->client);
     $path = "/subscriptions";
     $data = array();
     $response = $request->get($path, $data, $options);
     $returnValues = array();
     // Handling for field subscriptions
     $a = array();
     $body = $response->getBody();
     foreach ($body['subscriptions'] as $v) {
         $tmp = new Subscription($this->client);
         $tmp->fillWithData($v);
         $a[] = $tmp;
     }
     $returnValues['Subscriptions'] = $a;
     return array_values($returnValues)[0];
 }