/** * Updates an item through an object endpoint. * * @param Entity $object API Entity object * * @return mixed * @throws \Exception */ public function update($object) { if ($object->validate()) { $data = array($this->recordKey => $object->toArray()); $response = $this->put($this->url . '/' . $object->getID(), $data); $this->validateResponse($response); return $response->getBody(); } else { // @todo: Better exception. throw new \Exception('API Entity did not have required properties'); } }