public function edit_post() { $taskId = $this->request_stack["arguments"][0]; $task = TaskQuery::create()->findOneById($taskId); $task->setTitle($_POST["title"])->setDescription($_POST["description"])->setWorktime($_POST["worktime"])->setEmployee(EmployeeQuery::create()->findOneById($_POST["employee"]))->setProject(ProjectQuery::create()->findOneById($_POST["project"]))->save(); $this->getRequest()->redirect("task", "view", array("id" => $taskId)); }
public function index() { $employees = EmployeeQuery::create()->find(); $employeeArray = array(); foreach ($employees as $employee) { $employeeArray[$employee->getId()] = $employee->getPerson()->toArray(); } $this->assign("employees", $employeeArray); $this->build("index"); }
public function getEmployee($id) { return EmployeeQuery::create()->findOneById($id); }
public function edit_post() { $project = $this->p->getProject($this->request_stack["arguments"][0]); $project->setName($_POST["name"])->setLimit($_POST["limit"])->setRate($_POST["rate"])->setEmployee(EmployeeQuery::create()->findOneById($_POST["employee"]))->save(); $this->getRequest()->redirect("project", "view", array("id" => $this->request_stack["arguments"][0])); }