Compare commits

..

No commits in common. "6dd655029263d6ba053763ae76c58a1f93486e87" and "60d5ae04acc1edc8446f035bfbb82e7431cfda51" have entirely different histories.

16 changed files with 94 additions and 270 deletions

View File

@ -11,8 +11,6 @@ class AffectationController extends AbstractController
#[Route('/affectation', name: 'app_affectation')]
public function index(): Response
{
return $this->render('affectation/index.html.twig', [
'controller_name' => 'AffectationController',
]);

View File

@ -12,6 +12,7 @@ class DashboardController extends AbstractController
#[Route('', name: '_index')]
public function index(): Response
{
return $this->render('dashboard/index.html.twig');
return $this->render('dashboard/dashboard.html.twig');
}
}

View File

@ -4,20 +4,17 @@ namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\UniqueConstraint(
columns: ['employee', 'ride']
)]
#[ORM\Table(name: 'Assignment')]
class Assignment
{
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Employee::class, inversedBy: 'assignments')]
#[ORM\Column(type: 'integer')]
#[ORM\OneToMany(targetEntity: Employee::class, mappedBy: 'assignments')]
#[ORM\JoinColumn(nullable: false)]
private ?Employee $employee = null;
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Ride::class, inversedBy: 'assignments')]
#[ORM\Column(type: 'integer')]
#[ORM\OneToMany(targetEntity: Ride::class, mappedBy: 'assignments')]
#[ORM\JoinColumn(nullable: false)]
private ?Ride $ride = null;
#[ORM\Column]

View File

@ -6,7 +6,7 @@ namespace App\Entity;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class Category
{
#[ORM\Id]
@ -17,8 +17,8 @@ class Category
#[ORM\Column(length: 30)]
private ?string $label = null;
#[ORM\OneToMany(targetEntity: MissionCategory::class, mappedBy: 'category')]
private Collection $missionCategories;
#[ORM\ManyToOne(targetEntity: MissionCategory::class, inversedBy: 'category')]
private Collection $missionCategory;
public function getId(): ?int
{
@ -54,31 +54,18 @@ class Category
$this->mission = $mission;
}
public function getMissionCategorie(): Collection
public function getMissionCategory(): Collection
{
return $this->missionCategories;
return $this->missionCategory;
}
public function addMissionCategory(MissionCategory $missionCategory): static
public function setMissionCategory(Collection $missionCategory): void
{
if(!$this->missionCategories->contains($missionCategory)) {
$this->missionCategories->add($missionCategory);
$missionCategory->setCategory($this);
}
return $this;
$this->missionCategory = $missionCategory;
}
public function removeMissionCategory(MissionCategory $missionCategory): static
{
if($this->missionCategories->removeElement($missionCategory)) {
if($missionCategory->getCategory() === $this) {
$missionCategory->setCategory(null);
}
}
return $this;
}
}

View File

@ -9,7 +9,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
#[ORM\Entity]
#[ORM\Entity(repositoryClass: EmployeeRepository::class)]
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_EMAIL', fields: ['email'])]
class Employee implements UserInterface, PasswordAuthenticatedUserInterface
{
@ -33,9 +33,8 @@ class Employee implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\Column]
private array $roles = [];
#[ORM\OneToMany(targetEntity: EmployeeSkill::class, mappedBy: 'employee')]
#[ORM\JoinColumn(referencedColumnName: 'employee')]
private Collection $employeeSkills;
#[ORM\ManyToOne(targetEntity: EmployeeSkill::class, inversedBy: 'employee')]
private Collection $employeeskills;
#[ORM\ManyToOne(targetEntity: Mission::class, inversedBy: 'employee')]
private Collection $missions;
@ -43,58 +42,40 @@ class Employee implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\ManyToOne(targetEntity: Incident::class, inversedBy: 'employee')]
private Collection $incidents;
#[ORM\OneToMany(targetEntity: Assignment::class, mappedBy: 'employee')]
#[ORM\JoinColumn(referencedColumnName: 'employee')]
#[ORM\ManyToOne(targetEntity: Assignment::class, inversedBy: 'employee')]
private Collection $assignments;
#[ORM\OneToMany(targetEntity: Representation::class, mappedBy: 'employee')]
#[ORM\JoinColumn(referencedColumnName: 'employee')]
#[ORM\ManyToOne(targetEntity: Representation::class, inversedBy: 'employee')]
private Collection $representations;
public function getEmployeeSkills(): Collection
public function getEmployeeskills(): Collection
{
return $this->employeeSkills;
return $this->employeeskills;
}
public function addEmployeeSkill(EmployeeSkill $employeeSkill): static
public function setEmployeeskills(Collection $employeeskills): void
{
if(!$this->employeeSkills->contains($employeeSkill)) {
$this->employeeSkills->add($employeeSkill);
$employeeSkill->setEmployee($this);
}
return $this;
$this->employeeskills = $employeeskills;
}
public function removeEmployeeSkill(EmployeeSkill $employeeSkill): static
public function getEmployeemissions(): Collection
{
if($this->employeeSkills->removeElement($employeeSkill)) {
if($employeeSkill->getEmployee() === $this) {
$employeeSkill->setEmployee(null);
}
}
return $this;
return $this->employeemissions;
}
public function getEmployeeMissions(): Collection
public function setEmployeemissions(Collection $employeemissions): void
{
return $this->employeeMissions;
$this->employeemissions = $employeemissions;
}
public function setEmployeeMissions(Collection $employeeMissions): void
public function getEmployeeincidents(): Collection
{
$this->employeeMissions = $employeeMissions;
return $this->employeeincidents;
}
public function getEmployeeIncidents(): Collection
public function setEmployeeincidents(Collection $employeeincidents): void
{
return $this->employeeIncidents;
}
public function setEmployeeIncidents(Collection $employeeIncidents): void
{
$this->employeeIncidents = $employeeIncidents;
$this->employeeincidents = $employeeincidents;
}
public function getAssignments(): Collection
@ -102,25 +83,9 @@ class Employee implements UserInterface, PasswordAuthenticatedUserInterface
return $this->assignments;
}
public function addAssigment(Assignment $assignment): static
public function setAssignments(Collection $assignments): void
{
if(!$this->assignments->contains($assignment)) {
$this->assignments->add($assignment);
$assignment->setEmployee($this);
}
return $this;
}
public function removeAssigment(Assignment $assignment): static
{
if($this->assignments->removeElement($assignment)) {
if($assignment->getEmployee() === $this) {
$assignment->setEmployee(null);
}
}
return $this;
$this->assignments = $assignments;
}
public function getRepresentations(): Collection
@ -128,25 +93,9 @@ class Employee implements UserInterface, PasswordAuthenticatedUserInterface
return $this->representations;
}
public function addRepresentation(Representation $representation): static
public function setRepresentations(Collection $representations): void
{
if(!$this->representations->contains($representation)) {
$this->representations->add($representation);
$representation->setEmployee($this);
}
return $this;
}
public function removeRepresentation(Representation $representation): static
{
if($this->representations->removeElement($representation)) {
if($representation->getEmployee() === $this) {
$representation->setEmployee(null);
}
}
return $this;
$this->representations = $representations;
}
public function getId(): ?int

View File

@ -4,20 +4,17 @@ namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\UniqueConstraint(
columns: ['employee', 'skill']
)]
#[ORM\Table(name: 'EmployeeSkill')]
class EmployeeSkill
{
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Employee::class, inversedBy: 'employeeSkills')]
#[ORM\Column(type: 'integer')]
#[ORM\OneToMany(targetEntity: Employee::class, mappedBy: 'EmployeeSkills')]
#[ORM\JoinColumn(nullable: false)]
private ?Employee $employee = null;
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Skill::class, inversedBy: 'employeeSkills')]
#[ORM\Column(type: 'integer')]
#[ORM\OneToMany(targetEntity: Skill::class, mappedBy: 'EmployeeSkills')]
#[ORM\JoinColumn(nullable: false)]
private ?Skill $skill = null;
public function getSkill(): ?Skill

View File

@ -5,7 +5,6 @@ namespace App\Entity;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class Incident
{
#[ORM\Id]

View File

@ -6,7 +6,7 @@ namespace App\Entity;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class IncidentType
{
#[ORM\Id]

View File

@ -6,7 +6,7 @@ namespace App\Entity;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class Mission
{
#[ORM\Id]
@ -17,44 +17,26 @@ class Mission
#[ORM\Column(length: 30)]
private ?string $label = null;
#[ORM\OneToMany(targetEntity: Requirement::class, mappedBy: 'mission')]
#[ORM\JoinColumn(referencedColumnName: 'mission')]
#[ORM\ManyToOne(targetEntity: Requirement::class, inversedBy: 'mission')]
private Collection $requirements;
#[ORM\OneToMany(targetEntity: Employee::class, mappedBy: 'mission')]
private ?Employee $employee = null;
private ?employee $employee = null;
#[ORM\OneToMany(targetEntity: Ride::class, mappedBy: 'mission')]
private ?Ride $ride;
#[ORM\OneToMany(targetEntity: MissionCategory::class, mappedBy: 'mission')]
#[ORM\JoinColumn(referencedColumnName: 'mission')]
private Collection $missionCategories;
#[ORM\ManyToOne(targetEntity: MissionCategory::class, inversedBy: 'mission')]
private Collection $missionCategory;
public function getRequirements(): Collection
{
return $this->requirements;
}
public function addRequirement(Requirement $requirement): static
public function setRequirements(Collection $requirements): void
{
if(!$this->requirements->contains($requirement)) {
$this->requirements->add($requirement);
$requirement->setMission($this);
}
return $this;
}
public function removeRequirement(Requirement $requirement): static
{
if($this->requirements->removeElement($requirement)) {
if($requirement->getMission() === $this) {
$requirement->setMission(null);
}
}
return $this;
$this->requirements = $requirements;
}
public function getEmployeemissions(): Collection
@ -122,31 +104,18 @@ class Mission
$this->ride = $ride;
}
public function getMissionCategorie(): Collection
public function getMissionCategory(): Collection
{
return $this->missionCategories;
return $this->missionCategory;
}
public function addMissionCategory(MissionCategory $missionCategory): static
public function setMissionCategory(Collection $missionCategory): void
{
if(!$this->missionCategories->contains($missionCategory)) {
$this->missionCategories->add($missionCategory);
$missionCategory->setMission($this);
}
return $this;
$this->missionCategory = $missionCategory;
}
public function removeMissionCategory(MissionCategory $missionCategory): static
{
if($this->missionCategories->removeElement($missionCategory)) {
if($missionCategory->getMission() === $this) {
$missionCategory->setMission(null);
}
}
return $this;
}
}

View File

@ -5,18 +5,17 @@ namespace App\Entity;
use App\Repository\MissionCategoryRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\UniqueConstraint(columns: ['mission', 'category'])]
#[ORM\Entity(repositoryClass: MissionCategoryRepository::class)]
class MissionCategory
{
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Mission::class, inversedBy: 'missionCategories')]
#[ORM\Column(type: 'integer')]
#[ORM\OneToMany(targetEntity: Mission::class, mappedBy: 'MissionCategory')]
#[ORM\JoinColumn(nullable: false)]
private ?Mission $mission = null;
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Category::class, inversedBy: 'missionCategories')]
#[ORM\Column(type: 'integer')]
#[ORM\OneToMany(targetEntity: Category::class, mappedBy: 'MissionCategory')]
#[ORM\JoinColumn(nullable: false)]
private ?Category $category = null;
public function getMission(): ?Mission

View File

@ -4,20 +4,17 @@ namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\UniqueConstraint(
columns: ['employee', 'ride']
)]
#[ORM\Table(name: 'Representation')]
class Representation
{
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Employee::class, inversedBy: 'representations')]
#[ORM\Column(type: 'integer')]
#[ORM\OneToMany(targetEntity: Employee::class, mappedBy: 'representations')]
#[ORM\JoinColumn(nullable: false)]
private ?Employee $employee = null;
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Ride::class, inversedBy: 'representations')]
#[ORM\Column(type: 'integer')]
#[ORM\OneToMany(targetEntity: Ride::class, mappedBy: 'representations')]
#[ORM\JoinColumn(nullable: false)]
private ?Ride $ride = null;
#[ORM\Column]

View File

@ -5,20 +5,17 @@ namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\UniqueConstraint(
columns: ['mission', 'skill']
)]
#[ORM\Table(name: 'Requirement')]
class Requirement
{
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Mission::class, inversedBy: 'requirements')]
#[ORM\Column(type: 'integer')]
#[ORM\OneToMany(targetEntity: Mission::class, mappedBy: 'requirements')]
#[ORM\JoinColumn(nullable: false)]
private ?Mission $mission = null;
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Skill::class, inversedBy: 'requirements')]
#[ORM\Column(type: 'integer')]
#[ORM\OneToMany(targetEntity: Skill::class, mappedBy: 'requirements')]
#[ORM\JoinColumn(nullable: false)]
private ?Skill $skill = null;
public function getMission(): ?Mission
@ -40,4 +37,7 @@ class Requirement
{
$this->skill = $skill;
}
}

View File

@ -5,7 +5,7 @@ namespace App\Entity;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class Ride
{
#[ORM\Id]
@ -19,12 +19,10 @@ class Ride
#[ORM\Column]
private ?int $count = null;
#[ORM\OneToMany(targetEntity: Assignment::class, mappedBy: 'ride')]
#[ORM\JoinColumn(referencedColumnName: 'ride')]
#[ORM\ManyToOne(targetEntity: Assignment::class, inversedBy: 'ride')]
private Collection $assignments;
#[ORM\OneToMany(targetEntity: Representation::class, mappedBy: 'ride')]
#[ORM\JoinColumn(referencedColumnName: 'ride')]
#[ORM\ManyToOne(targetEntity: Representation::class, inversedBy: 'ride')]
private Collection $representations;
#[ORM\ManyToOne(targetEntity: IncidentType::class, inversedBy: 'ride')]
@ -38,25 +36,9 @@ class Ride
return $this->assignments;
}
public function addAssigment(Assignment $assignment): static
public function setAssignments(Collection $assignments): void
{
if(!$this->assignments->contains($assignment)) {
$this->assignments->add($assignment);
$assignment->setRide($this);
}
return $this;
}
public function removeAssigment(Assignment $assignment): static
{
if($this->assignments->removeElement($assignment)) {
if($assignment->getRide() === $this) {
$assignment->setRide(null);
}
}
return $this;
$this->assignments = $assignments;
}
public function getRepresentations(): Collection
@ -64,26 +46,12 @@ class Ride
return $this->representations;
}
public function addRepresentation(Representation $representation): static
public function setRepresentations(Collection $representations): void
{
if(!$this->representations->contains($representation)) {
$this->representations->add($representation);
$representation->setRide($this);
}
return $this;
$this->representations = $representations;
}
public function removeRepresentation(Representation $representation): static
{
if($this->representations->removeElement($representation)) {
if($representation->getRide() === $this) {
$representation->setRide(null);
}
}
return $this;
}
public function getId(): ?int
{

View File

@ -5,7 +5,7 @@ namespace App\Entity;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class Skill
{
#[ORM\Id]
@ -16,40 +16,33 @@ class Skill
#[ORM\Column(length: 30)]
private ?string $label = null;
#[ORM\OneToMany(targetEntity: Requirement::class, mappedBy: 'skill')]
#[ORM\JoinColumn(referencedColumnName: 'skill')]
#[ORM\ManyToOne(targetEntity: Requirement::class, inversedBy: 'skill')]
private Collection $requirements;
#[ORM\OneToMany(targetEntity: EmployeeSkill::class, mappedBy: 'skill')]
#[ORM\JoinColumn(referencedColumnName: 'skill')]
private Collection $employeeSkills;
#[ORM\ManyToOne(targetEntity: EmployeeSkill::class, inversedBy: 'skill')]
private Collection $employeeskills;
public function getRequirements(): Collection
{
return $this->requirements;
}
public function addRequirement(Requirement $requirement): static
public function setRequirements(Collection $requirements): void
{
if(!$this->requirements->contains($requirement)) {
$this->requirements->add($requirement);
$requirement->setSkill($this);
}
return $this;
$this->requirements = $requirements;
}
public function removeRequirement(Requirement $requirement): static
public function getEmployeeskills(): Collection
{
if($this->requirements->removeElement($requirement)) {
if($requirement->getSkill() === $this) {
$requirement->setSkill(null);
}
}
return $this;
return $this->employeeskills;
}
public function setEmployeeskills(Collection $employeeskills): void
{
$this->employeeskills = $employeeskills;
}
public function getId(): ?int
{
return $this->id;
@ -74,30 +67,5 @@ class Skill
return $this;
}
public function getEmployeeSkills(): Collection
{
return $this->employeeSkills;
}
public function addEmployeeSkill(EmployeeSkill $employeeSkill): static
{
if(!$this->employeeSkills->contains($employeeSkill)) {
$this->employeeSkills->add($employeeSkill);
$employeeSkill->setSkill($this);
}
return $this;
}
public function removeEmployeeSkill(EmployeeSkill $employeeSkill): static
{
if($this->employeeSkills->removeElement($employeeSkill)) {
if($employeeSkill->getSkill() === $this) {
$employeeSkill->setSkill(null);
}
}
return $this;
}
}

View File

@ -12,11 +12,6 @@
{% endblock %}
</head>
<body>
<header>
</header>
{% block body %}
{% endblock %}
{% block body %}{% endblock %}
</body>
</html>