Finished RelationService.php

This commit is contained in:
Yann ASTIER 2024-10-24 23:58:15 +02:00
parent 3b353cde0b
commit e66a2510ca
2 changed files with 62 additions and 0 deletions

View File

@ -14,4 +14,6 @@ class DashboardController extends AbstractController
{
return $this->render('dashboard/index.html.twig');
}
}

View File

@ -1 +1,61 @@
<?php
namespace App\Service;
use App\Entity\Assignment;
use App\Entity\Category;
use App\Entity\Employee;
use App\Entity\EmployeeSkill;
use App\Entity\Mission;
use App\Entity\MissionCategory;
use App\Entity\Representation;
use App\Entity\Requirement;
use App\Entity\Ride;
use App\Entity\Skill;
class RelationService {
public function setAssignment(Ride $ride, Employee $employee, \DateTime $startHour, \DateTime $endHour )
{
$assignment = new Assignment();
$assignment->setEmployee($employee);
$assignment->setRide($ride);
$assignment->setStartHour($startHour);
$assignment->setEndHour($endHour);
}
public function setEmployeeSkill(Skill $skill, Employee $employee )
{
$employeeSkill = new EmployeeSkill();
$employeeSkill->setEmployee($employee);
$employeeSkill->setSkill($skill);
}
public function setMissionCategory(Mission $mission, Category $category )
{
$missionCategory = new MissionCategory();
$missionCategory->setMission($mission);
$missionCategory->setCategory($category);
}
public function setRepresentation(Ride $ride, Employee $employee,int $count ,\DateTime $date )
{
$representation = new Representation();
$representation->setRide($ride);
$representation->setEmployee($employee);
$representation->setCount($count);
$representation->setDate($date);
}
public function setRequirement(Skill $skill, Mission $mission )
{
$requirement = new Requirement();
$requirement->setSkill($skill);
$requirement->setMission($mission);
}
}