public function fetchAll() { $resultSet = $this->getDbTable()->fetchAll(); $entries = array(); foreach ($resultSet as $row) { $entry = new Application_Model_Guestbook(); $entry->setId($row->id)->setEmail($row->email)->setComment($row->comment)->setCreated($row->created); $entries[] = $entry; } return $entries; }
public function signAction() { $request = $this->getRequest(); $form = new Application_Form_Guestbook(); if ($this->getRequest()->isPost()) { if ($form->isValid($request->getPost())) { $comment = new Application_Model_Guestbook($form->getValues()); $mapper = new Application_Model_GuestbookMapper(); echo $comment->getComment(); $mapper->save($comment); // return $this->_helper->redirector('index'); } } $this->view->form = $form; }