/** * Set Plan * Plan used to create this subscription * @param object $value * @return $this */ public function setPlan($value) { if (is_object($value)) { $this->plan = $value; } else { $obj = new Plan($this->client); $obj->fillWithData($value); $this->plan = $obj; } return $this; }
/** * Get all the plans. * @param array $options * @return array */ public function all($options = array()) { $request = new Request($this->client); $path = "/plans"; $data = array(); $response = $request->get($path, $data, $options); $returnValues = array(); // Handling for field plans $a = array(); $body = $response->getBody(); foreach ($body['plans'] as $v) { $tmp = new Plan($this->client); $tmp->fillWithData($v); $a[] = $tmp; } $returnValues['Plans'] = $a; return array_values($returnValues)[0]; }