Ejemplo n.º 1
0
 public function getJob($req)
 {
     $cr = new CategoriesRepository();
     $categories = $cr->getAll();
     $jr = new JobsRepository();
     $job = $jr->getById($req->id);
     return $this->twig->render('job.html', compact('categories', 'job'));
 }
Ejemplo n.º 2
0
 public function getEdit($req)
 {
     $jr = new JobsRepository();
     $job = $jr->getById($req->id);
     $cr = new CategoriesRepository();
     $categories = $cr->getAll();
     $ar = new ApplicationsRepository();
     $applications = $ar->getByJobId($req->id);
     return $this->twig->render('admin/jobs/edit.html', compact('job', 'categories', 'applications'));
 }
Ejemplo n.º 3
0
 public function getDelete($req)
 {
     $jr = new JobsRepository();
     $jr->deleteByCategoryId($req->id);
     $cr = new CategoriesRepository();
     $category = $cr->getById($req->id);
     $result = $category->delete();
     if ($result) {
         $this->service->flash('The category and its additional jobs have been deleted.', 'success');
     } else {
         $this->service->flash('Can\'t delete the category.', 'alert');
     }
     return $this->service->back();
 }