public function deleteEmployee($id, array $data) { $employeeMapper = new Application_Model_Mapper_Employees(); $employee = $employeeMapper->findById($id); $employeeMapper->delete($employee); $this->setFlag(true)->setMsg("success", "Employee deleted!"); return $this->getResult(); }
public function indexAction() { $params = $this->params; // $emp = new Application_Model_Service_Employees(); // $data = array( // "firstname" => $params["firstname"], // "lastname" => $params["lastname"] // ); // $result = $emp->createNewEmployee($data); if ($this->getRequest()->isPost()) { $emp = new Application_Model_Mapper_Employees(); $employee = $emp->findById($params[id]); $employee = $employee->toArray(); $this->view->result = $employee; } }