public function saveClientAction() { $aNamespace = new Zend_Session_Namespace('zs_User'); $post = $this->getRequest()->getPost(); $clients = new Default_Model_Clients(); $clients->setId($post['id']); $clients->setName($post['name']); $clients->setBirthday($post['birthday']); $clients->setEmail($post['email']); $clients->setPhone($post['phone']); $clients->setPoint($post['point']); $clients->setConsultant($post['consultant']); $clientsMapper = new Default_Model_ClientsMapper(); $clientsMapper->save($clients); $this->_redirect('/clients'); }
public function fetchAll($where = null, $orderby = null) { $resultSet = $this->getDbTable()->fetchAll($where, $orderby); $entries = array(); $entry = new Default_Model_Clients(); foreach ($resultSet as $row) { $entry->getId($row['id']); $entry->getName($row['name']); $entry->setBirthday($row['birthday']); $entry->setEmail($row['email']); $entry->setPhone($row['phone']); $entry->setPoint($row['point']); $entry->setConsultant($row['consultant']); $entries[] = $entry; } return $entries; }