Exemple #1
0
 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]);
 }
Exemple #2
0
 public function insert(Clientes $clientes)
 {
     return $this->tableGateway->insert($clientes->getArrayCopy());
 }