public function fetchAll() { $table = $this->getDbTable(); $select = $table->select(); $select->from($table, array('id', 'name')); $select->where('status = ?', true); $select->order('name ASC'); $resultSet = $table->fetchAll($select); $entries = array(); foreach ($resultSet as $row) { $entry = new Gyuser_Model_EventAction(); $entry->setId($row->id); $entry->setName($row->name); $entries[] = $entry; } return $entries; }
public function deleteeventactionajaxAction() { try { $request = $this->getRequest(); if ($this->getRequest()->isPost()) { $mapper = new Gyuser_Model_EventActionDataMapper(); $Obj = new Gyuser_Model_EventAction(); $Obj->setId($request->id); $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $result = $mapper->delete($Obj); if ($result) { echo $result; } else { echo "f"; } } } catch (Exception $e) { echo $e; } }