/** * Get one customer * * GET /api/customers/{id} */ public function getAction() { $id = $this->Request()->getParam('id'); $customer = $this->resource->getOne($id); $this->View()->assign('data', $customer); $this->View()->assign('success', true); }
/** * Get one customer * * GET /api/customers/{id} */ public function getAction() { $id = $this->Request()->getParam('id'); $useNumberAsId = (bool) $this->Request()->getParam('useNumberAsId', 0); if ($useNumberAsId) { $customer = $this->resource->getOneByNumber($id); } else { $customer = $this->resource->getOne($id); } $this->View()->assign('data', $customer); $this->View()->assign('success', true); }