/** * Update customer * * PUT /api/customers/{id} */ public function putAction() { $id = $this->Request()->getParam('id'); $useNumberAsId = (bool) $this->Request()->getParam('useNumberAsId', 0); $params = $this->Request()->getPost(); if ($useNumberAsId) { $customer = $this->resource->updateByNumber($id, $params); } else { $customer = $this->resource->update($id, $params); } $location = $this->apiBaseUrl . 'customers/' . $customer->getId(); $data = array('id' => $customer->getId(), 'location' => $location); $this->View()->assign(array('success' => true, 'data' => $data)); }