public function editAction() { $cliente = $this->getServiceLocator()->get('Application\\Model\\ClientesTable')->find($this->params()->fromRoute('id')); if ($this->getRequest()->isPost()) { $data = $this->params()->fromPost(); $data['id'] = $this->params()->fromRoute('id'); $cliente = new Clientes(); $cliente->exchangeArray($data); $table = $this->getServiceLocator()->get('Application\\Model\\ClientesTable')->update($cliente); return $this->redirect()->toUrl('/application/index/index'); } return new ViewModel(['cliente' => $cliente]); }
public function insert(Clientes $clientes) { return $this->tableGateway->insert($clientes->getArrayCopy()); }