Finished RelationService.php
This commit is contained in:
parent
3b353cde0b
commit
e66a2510ca
@ -14,4 +14,6 @@ class DashboardController extends AbstractController
|
||||
{
|
||||
return $this->render('dashboard/index.html.twig');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user