Missing IncidentType & Incident + Mission & Category relations

This commit is contained in:
ASTIER Yann 2024-09-26 17:57:11 +02:00
parent 168ff58d15
commit 1531c122b8
6 changed files with 130 additions and 2 deletions

25
src/Entity/Assignment.php Normal file
View File

@ -0,0 +1,25 @@
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'Assignment')]
class Assignment
{
#[ORM\Id]
#[ORM\OneToMany(targetEntity: Employee::class, mappedBy: 'assignments')]
#[ORM\JoinColumn(nullable: false)]
private ?Employee $employee = null;
#[ORM\Id]
#[ORM\OneToMany(targetEntity: Ride::class, mappedBy: 'assignments')]
#[ORM\JoinColumn(nullable: false)]
private ?Ride $ride = null;
#[ORM\Column]
private ?\DateTime $startHour = null;
#[ORM\Column]
private ?\DateTime $endHour = null;
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'EmployeeIncident')]
class EmployeeIncident
{
#[ORM\Id]
#[ORM\OneToMany(targetEntity: Employee::class, mappedBy: 'EmployeeIncidents')]
#[ORM\JoinColumn(nullable: false)]
private ?Employee $employee = null;
#[ORM\Id]
#[ORM\OneToMany(targetEntity: Incident::class, mappedBy: 'EmployeeIncidents')]
#[ORM\JoinColumn(nullable: false)]
private ?Incident $incident = null;
}

View File

@ -0,0 +1,20 @@
<?php
namespace App\Entity;
use App\Repository\EmployeeMissionRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: EmployeeMissionRepository::class)]
class EmployeeMission
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
public function getId(): ?int
{
return $this->id;
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'Requirements')]
class Requirements
{
#[ORM\Id]
#[ORM\OneToMany(targetEntity: Mission::class, mappedBy: 'requirements')]
#[ORM\JoinColumn(nullable: false)]
private ?Mission $mission = null;
#[ORM\Id]
#[ORM\OneToMany(targetEntity: Skill::class, mappedBy: 'requirements')]
#[ORM\JoinColumn(nullable: false)]
private ?Skill $skill = null;
}

View File

@ -0,0 +1,45 @@
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'Representation')]
class Representation
{
#[ORM\Id]
#[ORM\OneToMany(targetEntity: Employee::class, mappedBy: 'representations')]
#[ORM\JoinColumn(nullable: false)]
private ?Employee $employee = null;
#[ORM\Id]
#[ORM\OneToMany(targetEntity: Ride::class, mappedBy: 'representations')]
#[ORM\JoinColumn(nullable: false)]
private ?Ride $ride = null;
#[ORM\Column]
private ?int $count = null;
public function getCount(): ?int
{
return $this->count;
}
public function setCount(?int $count): void
{
$this->count = $count;
}
#[ORM\Column]
private ?\DateTime $date = null;
public function getDate(): ?\DateTime
{
return $this->date;
}
public function setDate(?\DateTime $date): void
{
$this->date = $date;
}
}

View File

@ -2,10 +2,10 @@
namespace App\Entity; namespace App\Entity;
use App\Repository\RequirementsRepository;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'Requirements')]
class Requirements class Requirements
{ {
#[ORM\Id] #[ORM\Id]