Пример #1
0
 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));
 }
Пример #2
0
 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");
 }
Пример #3
0
 public function getEmployee($id)
 {
     return EmployeeQuery::create()->findOneById($id);
 }
Пример #4
0
 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]));
 }