/** * Update a resource * * @param array $data * @return Resource */ public function update($data = array()) { foreach ($data as $key => $value) { $this->{$key} = $value; } $postData = array(); foreach (static::$properties as $name) { $postData[$name] = $this->data[$name]; } $this->client->put(static::$path . '/' . $this->id(), $postData); return $this; }