Ejemplo n.º 1
0
    /**
     * 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);
    }
Ejemplo n.º 2
0
 /**
  * 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);
 }