Compare commits
19 Commits
master
...
feature/lo
Author | SHA1 | Date | |
---|---|---|---|
17fd3ef23a | |||
e7a9a3fd5c | |||
2782b154ed | |||
6dd6550292 | |||
60d5ae04ac | |||
6860e00bf8 | |||
922834da8a | |||
cbce2ca3c6 | |||
428ee14836 | |||
7a4c7aa01e | |||
3ba44656b3 | |||
2dc0f69e4d | |||
b8e03593af | |||
df69ccf634 | |||
6903630012 | |||
f0c7c03b9b | |||
1531c122b8 | |||
|
168ff58d15 | ||
e29b52cb83 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -23,3 +23,5 @@
|
|||||||
/public/assets/
|
/public/assets/
|
||||||
/assets/vendor/
|
/assets/vendor/
|
||||||
###< symfony/asset-mapper ###
|
###< symfony/asset-mapper ###
|
||||||
|
|
||||||
|
.idea/
|
@ -1,3 +1,10 @@
|
|||||||
body {
|
body {
|
||||||
background-color: skyblue;
|
background-color: #31393C;
|
||||||
}
|
}
|
||||||
|
.wrapper {
|
||||||
|
color: #D0DDD7;
|
||||||
|
margin: 1em auto;
|
||||||
|
max-width: 800px;
|
||||||
|
width: 95%;
|
||||||
|
font: 18px/1.5 sans-serif;
|
||||||
|
}
|
76
assets/styles/style.css
Normal file
76
assets/styles/style.css
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
body {
|
||||||
|
background: linear-gradient(to right, #5CE1E6, #C1FF72, #cb6ce6);
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
text-align: center;
|
||||||
|
font-family: "Fredoka", sans-serif;
|
||||||
|
font-optical-sizing: auto;
|
||||||
|
font-style: normal;
|
||||||
|
font-variation-settings: "wdth" 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 60%;
|
||||||
|
height: auto;
|
||||||
|
float: right;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: auto;
|
||||||
|
margin: auto 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
form {
|
||||||
|
margin-right: 20px;
|
||||||
|
background: rgba(255, 255, 255, 0.15);
|
||||||
|
border-radius: 16px;
|
||||||
|
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
|
||||||
|
backdrop-filter: blur(8px);
|
||||||
|
-webkit-backdrop-filter: blur(8px);
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
form div {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo{
|
||||||
|
margin-bottom: 65%;
|
||||||
|
margin-right: 30%;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
font-family: "Fredoka", sans-serif;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="text"],
|
||||||
|
input[type="password"] {
|
||||||
|
width: 90%;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
padding: 10px 20px;
|
||||||
|
background-color: #5CE1E6;
|
||||||
|
color: black;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
background-color: #CB6CE6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit {
|
||||||
|
margin-left: 15%;
|
||||||
|
}
|
@ -4,14 +4,18 @@ security:
|
|||||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
||||||
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
||||||
providers:
|
providers:
|
||||||
users_in_memory: { memory: null }
|
# used to reload user from session & other features (e.g. switch_user)
|
||||||
|
app_user_provider:
|
||||||
|
entity:
|
||||||
|
class: App\Entity\Employee
|
||||||
|
property: email
|
||||||
firewalls:
|
firewalls:
|
||||||
dev:
|
dev:
|
||||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||||
security: false
|
security: false
|
||||||
main:
|
main:
|
||||||
lazy: true
|
lazy: true
|
||||||
provider: users_in_memory
|
provider: app_user_provider
|
||||||
|
|
||||||
# activate different ways to authenticate
|
# activate different ways to authenticate
|
||||||
# https://symfony.com/doc/current/security.html#the-firewall
|
# https://symfony.com/doc/current/security.html#the-firewall
|
||||||
|
105
migrations/Version20241011084601.php
Normal file
105
migrations/Version20241011084601.php
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20241011084601 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE SEQUENCE category_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
|
$this->addSql('CREATE SEQUENCE employee_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
|
$this->addSql('CREATE SEQUENCE incident_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
|
$this->addSql('CREATE SEQUENCE incident_type_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
|
$this->addSql('CREATE SEQUENCE mission_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
|
$this->addSql('CREATE SEQUENCE ride_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
|
$this->addSql('CREATE SEQUENCE skill_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
|
$this->addSql('CREATE TABLE assignment (employee INT NOT NULL, ride INT NOT NULL, start_hour TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, end_hour TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(employee, ride))');
|
||||||
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_30C544BA5D9F75A19B3D7CD0 ON assignment (employee, ride)');
|
||||||
|
$this->addSql('CREATE TABLE category (id INT NOT NULL, label VARCHAR(30) NOT NULL, PRIMARY KEY(id))');
|
||||||
|
$this->addSql('CREATE TABLE employee (id INT NOT NULL, missions_id INT DEFAULT NULL, incidents_id INT DEFAULT NULL, email VARCHAR(180) NOT NULL, first_name VARCHAR(30) NOT NULL, last_name VARCHAR(30) NOT NULL, password VARCHAR(255) NOT NULL, roles JSON NOT NULL, PRIMARY KEY(id))');
|
||||||
|
$this->addSql('CREATE INDEX IDX_5D9F75A117C042CF ON employee (missions_id)');
|
||||||
|
$this->addSql('CREATE INDEX IDX_5D9F75A155955332 ON employee (incidents_id)');
|
||||||
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL ON employee (email)');
|
||||||
|
$this->addSql('CREATE TABLE employee_skill (employee INT NOT NULL, skill INT NOT NULL, PRIMARY KEY(employee, skill))');
|
||||||
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_B630E90E5D9F75A15E3DE477 ON employee_skill (employee, skill)');
|
||||||
|
$this->addSql('CREATE TABLE incident (id INT NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
||||||
|
$this->addSql('CREATE TABLE incident_type (id INT NOT NULL, incidents_id INT DEFAULT NULL, label VARCHAR(30) NOT NULL, PRIMARY KEY(id))');
|
||||||
|
$this->addSql('CREATE INDEX IDX_66D2209655955332 ON incident_type (incidents_id)');
|
||||||
|
$this->addSql('CREATE TABLE mission (id INT NOT NULL, label VARCHAR(30) NOT NULL, PRIMARY KEY(id))');
|
||||||
|
$this->addSql('CREATE TABLE mission_category (mission INT NOT NULL, category INT NOT NULL, PRIMARY KEY(mission, category))');
|
||||||
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_EB018789067F23C64C19C1 ON mission_category (mission, category)');
|
||||||
|
$this->addSql('CREATE TABLE representation (employee INT NOT NULL, ride INT NOT NULL, count INT NOT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(employee, ride))');
|
||||||
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_29D5499E5D9F75A19B3D7CD0 ON representation (employee, ride)');
|
||||||
|
$this->addSql('CREATE TABLE requirement (mission INT NOT NULL, skill INT NOT NULL, PRIMARY KEY(mission, skill))');
|
||||||
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_DB3F55509067F23C5E3DE477 ON requirement (mission, skill)');
|
||||||
|
$this->addSql('CREATE TABLE ride (id INT NOT NULL, incident_types_id INT DEFAULT NULL, missions_id INT DEFAULT NULL, label VARCHAR(30) NOT NULL, count INT NOT NULL, PRIMARY KEY(id))');
|
||||||
|
$this->addSql('CREATE INDEX IDX_9B3D7CD076775724 ON ride (incident_types_id)');
|
||||||
|
$this->addSql('CREATE INDEX IDX_9B3D7CD017C042CF ON ride (missions_id)');
|
||||||
|
$this->addSql('CREATE TABLE skill (id INT NOT NULL, label VARCHAR(30) NOT NULL, PRIMARY KEY(id))');
|
||||||
|
$this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
|
||||||
|
$this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)');
|
||||||
|
$this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)');
|
||||||
|
$this->addSql('CREATE INDEX IDX_75EA56E016BA31DB ON messenger_messages (delivered_at)');
|
||||||
|
$this->addSql('COMMENT ON COLUMN messenger_messages.created_at IS \'(DC2Type:datetime_immutable)\'');
|
||||||
|
$this->addSql('COMMENT ON COLUMN messenger_messages.available_at IS \'(DC2Type:datetime_immutable)\'');
|
||||||
|
$this->addSql('COMMENT ON COLUMN messenger_messages.delivered_at IS \'(DC2Type:datetime_immutable)\'');
|
||||||
|
$this->addSql('CREATE OR REPLACE FUNCTION notify_messenger_messages() RETURNS TRIGGER AS $$
|
||||||
|
BEGIN
|
||||||
|
PERFORM pg_notify(\'messenger_messages\', NEW.queue_name::text);
|
||||||
|
RETURN NEW;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;');
|
||||||
|
$this->addSql('DROP TRIGGER IF EXISTS notify_trigger ON messenger_messages;');
|
||||||
|
$this->addSql('CREATE TRIGGER notify_trigger AFTER INSERT OR UPDATE ON messenger_messages FOR EACH ROW EXECUTE PROCEDURE notify_messenger_messages();');
|
||||||
|
$this->addSql('ALTER TABLE employee ADD CONSTRAINT FK_5D9F75A117C042CF FOREIGN KEY (missions_id) REFERENCES mission (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
$this->addSql('ALTER TABLE employee ADD CONSTRAINT FK_5D9F75A155955332 FOREIGN KEY (incidents_id) REFERENCES incident (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
$this->addSql('ALTER TABLE incident_type ADD CONSTRAINT FK_66D2209655955332 FOREIGN KEY (incidents_id) REFERENCES incident (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
$this->addSql('ALTER TABLE ride ADD CONSTRAINT FK_9B3D7CD076775724 FOREIGN KEY (incident_types_id) REFERENCES incident_type (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
$this->addSql('ALTER TABLE ride ADD CONSTRAINT FK_9B3D7CD017C042CF FOREIGN KEY (missions_id) REFERENCES mission (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE SCHEMA public');
|
||||||
|
$this->addSql('DROP SEQUENCE category_id_seq CASCADE');
|
||||||
|
$this->addSql('DROP SEQUENCE employee_id_seq CASCADE');
|
||||||
|
$this->addSql('DROP SEQUENCE incident_id_seq CASCADE');
|
||||||
|
$this->addSql('DROP SEQUENCE incident_type_id_seq CASCADE');
|
||||||
|
$this->addSql('DROP SEQUENCE mission_id_seq CASCADE');
|
||||||
|
$this->addSql('DROP SEQUENCE ride_id_seq CASCADE');
|
||||||
|
$this->addSql('DROP SEQUENCE skill_id_seq CASCADE');
|
||||||
|
$this->addSql('ALTER TABLE employee DROP CONSTRAINT FK_5D9F75A117C042CF');
|
||||||
|
$this->addSql('ALTER TABLE employee DROP CONSTRAINT FK_5D9F75A155955332');
|
||||||
|
$this->addSql('ALTER TABLE incident_type DROP CONSTRAINT FK_66D2209655955332');
|
||||||
|
$this->addSql('ALTER TABLE ride DROP CONSTRAINT FK_9B3D7CD076775724');
|
||||||
|
$this->addSql('ALTER TABLE ride DROP CONSTRAINT FK_9B3D7CD017C042CF');
|
||||||
|
$this->addSql('DROP TABLE assignment');
|
||||||
|
$this->addSql('DROP TABLE category');
|
||||||
|
$this->addSql('DROP TABLE employee');
|
||||||
|
$this->addSql('DROP TABLE employee_skill');
|
||||||
|
$this->addSql('DROP TABLE incident');
|
||||||
|
$this->addSql('DROP TABLE incident_type');
|
||||||
|
$this->addSql('DROP TABLE mission');
|
||||||
|
$this->addSql('DROP TABLE mission_category');
|
||||||
|
$this->addSql('DROP TABLE representation');
|
||||||
|
$this->addSql('DROP TABLE requirement');
|
||||||
|
$this->addSql('DROP TABLE ride');
|
||||||
|
$this->addSql('DROP TABLE skill');
|
||||||
|
$this->addSql('DROP TABLE messenger_messages');
|
||||||
|
}
|
||||||
|
}
|
20
src/Controller/AffectationController.php
Normal file
20
src/Controller/AffectationController.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
|
class AffectationController extends AbstractController
|
||||||
|
{
|
||||||
|
#[Route('/affectation', name: 'app_affectation')]
|
||||||
|
public function index(): Response
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
return $this->render('affectation/index.html.twig', [
|
||||||
|
'controller_name' => 'AffectationController',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
@ -6,13 +6,12 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
#[Route('/dashboard', name: 'IndexController')]
|
#[Route('/dashboard', name: 'DashboardController')]
|
||||||
class IndexController extends AbstractController
|
class DashboardController extends AbstractController
|
||||||
{
|
{
|
||||||
#[Route('', name: '_index')]
|
#[Route('', name: '_index')]
|
||||||
public function index(): Response
|
public function index(): Response
|
||||||
{
|
{
|
||||||
|
return $this->render('dashboard/index.html.twig');
|
||||||
return $this->render('index/index.html.twig');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
18
src/Controller/IncidentController.php
Normal file
18
src/Controller/IncidentController.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
|
class IncidentController extends AbstractController
|
||||||
|
{
|
||||||
|
#[Route('/incident', name: 'app_incident')]
|
||||||
|
public function index(): Response
|
||||||
|
{
|
||||||
|
return $this->render('incident/index.html.twig', [
|
||||||
|
'controller_name' => 'IncidentController',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
18
src/Controller/RepresentationController.php
Normal file
18
src/Controller/RepresentationController.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
|
class RepresentationController extends AbstractController
|
||||||
|
{
|
||||||
|
#[Route('/representation', name: 'app_representation')]
|
||||||
|
public function index(): Response
|
||||||
|
{
|
||||||
|
return $this->render('representation/index.html.twig', [
|
||||||
|
'controller_name' => 'RepresentationController',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
70
src/Entity/Assignment.php
Normal file
70
src/Entity/Assignment.php
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity]
|
||||||
|
#[ORM\UniqueConstraint(
|
||||||
|
columns: ['employee', 'ride']
|
||||||
|
)]
|
||||||
|
class Assignment
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\ManyToOne(targetEntity: Employee::class, inversedBy: 'assignments')]
|
||||||
|
#[ORM\Column(type: 'integer')]
|
||||||
|
private ?Employee $employee = null;
|
||||||
|
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\ManyToOne(targetEntity: Ride::class, inversedBy: 'assignments')]
|
||||||
|
#[ORM\Column(type: 'integer')]
|
||||||
|
private ?Ride $ride = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?\DateTime $startHour = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?\DateTime $endHour = null;
|
||||||
|
|
||||||
|
public function getStartHour(): ?\DateTime
|
||||||
|
{
|
||||||
|
return $this->startHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEmployee(): ?Employee
|
||||||
|
{
|
||||||
|
return $this->employee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setEmployee(?Employee $employee): void
|
||||||
|
{
|
||||||
|
$this->employee = $employee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRide(): ?Ride
|
||||||
|
{
|
||||||
|
return $this->ride;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setRide(?Ride $ride): void
|
||||||
|
{
|
||||||
|
$this->ride = $ride;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setStartHour(?\DateTime $startHour): void
|
||||||
|
{
|
||||||
|
$this->startHour = $startHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEndHour(): ?\DateTime
|
||||||
|
{
|
||||||
|
return $this->endHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setEndHour(?\DateTime $endHour): void
|
||||||
|
{
|
||||||
|
$this->endHour = $endHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1 +1,84 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity]
|
||||||
|
class Category
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 30)]
|
||||||
|
private ?string $label = null;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(targetEntity: MissionCategory::class, mappedBy: 'category')]
|
||||||
|
private Collection $missionCategories;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setId(int $id): static
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLabel(): ?string
|
||||||
|
{
|
||||||
|
return $this->label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setLabel(string $label): static
|
||||||
|
{
|
||||||
|
$this->label = $label;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMission(): ?Mission
|
||||||
|
{
|
||||||
|
return $this->mission;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setMission(?Mission $mission): void
|
||||||
|
{
|
||||||
|
$this->mission = $mission;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMissionCategorie(): Collection
|
||||||
|
{
|
||||||
|
return $this->missionCategories;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addMissionCategory(MissionCategory $missionCategory): static
|
||||||
|
{
|
||||||
|
if(!$this->missionCategories->contains($missionCategory)) {
|
||||||
|
$this->missionCategories->add($missionCategory);
|
||||||
|
$missionCategory->setCategory($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeMissionCategory(MissionCategory $missionCategory): static
|
||||||
|
{
|
||||||
|
if($this->missionCategories->removeElement($missionCategory)) {
|
||||||
|
if($missionCategory->getCategory() === $this) {
|
||||||
|
$missionCategory->setCategory(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -2,23 +2,153 @@
|
|||||||
|
|
||||||
namespace App\Entity;
|
namespace App\Entity;
|
||||||
|
|
||||||
|
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
use App\Repository\EmployeeRepository;
|
use App\Repository\EmployeeRepository;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||||
|
use Symfony\Component\Security\Core\User\UserInterface;
|
||||||
|
|
||||||
#[ORM\Entity(repositoryClass: EmployeeRepository::class)]
|
#[ORM\Entity]
|
||||||
class Employee
|
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_EMAIL', fields: ['email'])]
|
||||||
|
class Employee implements UserInterface, PasswordAuthenticatedUserInterface
|
||||||
{
|
{
|
||||||
#[ORM\Id]
|
#[ORM\Id]
|
||||||
#[ORM\GeneratedValue]
|
#[ORM\GeneratedValue]
|
||||||
#[ORM\Column]
|
#[ORM\Column]
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 180)]
|
||||||
|
private ?string $email = null;
|
||||||
|
|
||||||
#[ORM\Column(length: 30)]
|
#[ORM\Column(length: 30)]
|
||||||
private ?string $firstName = null;
|
private ?string $firstName = null;
|
||||||
|
|
||||||
#[ORM\Column(length: 30)]
|
#[ORM\Column(length: 30)]
|
||||||
private ?string $lastName = null;
|
private ?string $lastName = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?string $password = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private array $roles = [];
|
||||||
|
|
||||||
|
#[ORM\OneToMany(targetEntity: EmployeeSkill::class, mappedBy: 'employee')]
|
||||||
|
#[ORM\JoinColumn(referencedColumnName: 'employee')]
|
||||||
|
private Collection $employeeSkills;
|
||||||
|
|
||||||
|
#[ORM\ManyToOne(targetEntity: Mission::class, inversedBy: 'employee')]
|
||||||
|
private Collection $missions;
|
||||||
|
|
||||||
|
#[ORM\ManyToOne(targetEntity: Incident::class, inversedBy: 'employee')]
|
||||||
|
private Collection $incidents;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(targetEntity: Assignment::class, mappedBy: 'employee')]
|
||||||
|
#[ORM\JoinColumn(referencedColumnName: 'employee')]
|
||||||
|
private Collection $assignments;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(targetEntity: Representation::class, mappedBy: 'employee')]
|
||||||
|
#[ORM\JoinColumn(referencedColumnName: 'employee')]
|
||||||
|
private Collection $representations;
|
||||||
|
|
||||||
|
public function getEmployeeSkills(): Collection
|
||||||
|
{
|
||||||
|
return $this->employeeSkills;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addEmployeeSkill(EmployeeSkill $employeeSkill): static
|
||||||
|
{
|
||||||
|
if(!$this->employeeSkills->contains($employeeSkill)) {
|
||||||
|
$this->employeeSkills->add($employeeSkill);
|
||||||
|
$employeeSkill->setEmployee($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeEmployeeSkill(EmployeeSkill $employeeSkill): static
|
||||||
|
{
|
||||||
|
if($this->employeeSkills->removeElement($employeeSkill)) {
|
||||||
|
if($employeeSkill->getEmployee() === $this) {
|
||||||
|
$employeeSkill->setEmployee(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEmployeeMissions(): Collection
|
||||||
|
{
|
||||||
|
return $this->employeeMissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setEmployeeMissions(Collection $employeeMissions): void
|
||||||
|
{
|
||||||
|
$this->employeeMissions = $employeeMissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEmployeeIncidents(): Collection
|
||||||
|
{
|
||||||
|
return $this->employeeIncidents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setEmployeeIncidents(Collection $employeeIncidents): void
|
||||||
|
{
|
||||||
|
$this->employeeIncidents = $employeeIncidents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAssignments(): Collection
|
||||||
|
{
|
||||||
|
return $this->assignments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addAssigment(Assignment $assignment): static
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRepresentations(): Collection
|
||||||
|
{
|
||||||
|
return $this->representations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addRepresentation(Representation $representation): static
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
@ -31,6 +161,18 @@ class Employee
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getEmail(): ?string
|
||||||
|
{
|
||||||
|
return $this->email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setEmail(string $email): static
|
||||||
|
{
|
||||||
|
$this->email = $email;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function getFirstName(): ?string
|
public function getFirstName(): ?string
|
||||||
{
|
{
|
||||||
return $this->firstName;
|
return $this->firstName;
|
||||||
@ -54,4 +196,68 @@ class Employee
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPassword(): ?string
|
||||||
|
{
|
||||||
|
return $this->password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPassword(string $password): static
|
||||||
|
{
|
||||||
|
$this->password = $password;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function eraseCredentials(): void
|
||||||
|
{
|
||||||
|
// If you store any temporary, sensitive data on the user, clear it here
|
||||||
|
// $this->plainPassword = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUserIdentifier(): string
|
||||||
|
{
|
||||||
|
return (string) $this->email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRoles(): array
|
||||||
|
{
|
||||||
|
$roles = $this->roles;
|
||||||
|
// guarantee every user at least has ROLE_USER
|
||||||
|
$roles[] = 'ROLE_USER';
|
||||||
|
|
||||||
|
return array_unique($roles);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param list<string> $roles
|
||||||
|
*/
|
||||||
|
public function setRoles(array $roles): static
|
||||||
|
{
|
||||||
|
$this->roles = $roles;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMissions(): Collection
|
||||||
|
{
|
||||||
|
return $this->missions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setMissions(Collection $missions): void
|
||||||
|
{
|
||||||
|
$this->missions = $missions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIncidents(): Collection
|
||||||
|
{
|
||||||
|
return $this->incidents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setIncidents(Collection $incidents): void
|
||||||
|
{
|
||||||
|
$this->incidents = $incidents;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
45
src/Entity/EmployeeSkill.php
Normal file
45
src/Entity/EmployeeSkill.php
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity]
|
||||||
|
#[ORM\UniqueConstraint(
|
||||||
|
columns: ['employee', 'skill']
|
||||||
|
)]
|
||||||
|
class EmployeeSkill
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\ManyToOne(targetEntity: Employee::class, inversedBy: 'employeeSkills')]
|
||||||
|
#[ORM\Column(type: 'integer')]
|
||||||
|
private ?Employee $employee = null;
|
||||||
|
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\ManyToOne(targetEntity: Skill::class, inversedBy: 'employeeSkills')]
|
||||||
|
#[ORM\Column(type: 'integer')]
|
||||||
|
private ?Skill $skill = null;
|
||||||
|
|
||||||
|
public function getSkill(): ?Skill
|
||||||
|
{
|
||||||
|
return $this->skill;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setSkill(?Skill $skill): void
|
||||||
|
{
|
||||||
|
$this->skill = $skill;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEmployee(): ?Employee
|
||||||
|
{
|
||||||
|
return $this->employee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setEmployee(?Employee $employee): void
|
||||||
|
{
|
||||||
|
$this->employee = $employee;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1 +1,95 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity]
|
||||||
|
class Incident
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $description = null;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(targetEntity: Employee::class, mappedBy: 'incident')]
|
||||||
|
private ?Employee $employee;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(targetEntity: IncidentType::class, mappedBy: 'incident')]
|
||||||
|
private ?IncidentType $incidentType;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(targetEntity: Ride::class, mappedBy: 'incident')]
|
||||||
|
private ?Ride $ride;
|
||||||
|
|
||||||
|
public function getEmployeeincidents(): Collection
|
||||||
|
{
|
||||||
|
return $this->employeeincidents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setEmployeeincidents(Collection $employeeincidents): void
|
||||||
|
{
|
||||||
|
$this->employeeincidents = $employeeincidents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setId(int $id): static
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescription(): ?string
|
||||||
|
{
|
||||||
|
return $this->description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setLabel(string $description): static
|
||||||
|
{
|
||||||
|
$this->description = $description;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEmployee(): ?Employee
|
||||||
|
{
|
||||||
|
return $this->employee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setEmployee(?Employee $employee): void
|
||||||
|
{
|
||||||
|
$this->employee = $employee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIncidentType(): ?IncidentType
|
||||||
|
{
|
||||||
|
return $this->incidentType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setIncidentType(?IncidentType $incidentType): void
|
||||||
|
{
|
||||||
|
$this->incidentType = $incidentType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRide(): ?Ride
|
||||||
|
{
|
||||||
|
return $this->ride;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setRide(?Ride $ride): void
|
||||||
|
{
|
||||||
|
$this->ride = $ride;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1 +1,60 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity]
|
||||||
|
class IncidentType
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 30)]
|
||||||
|
private ?string $label = null;
|
||||||
|
|
||||||
|
#[ORM\ManyToOne(targetEntity: Incident::class, inversedBy: 'incidentType')]
|
||||||
|
private Collection $incidents;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setId(int $id): static
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLabel(): ?string
|
||||||
|
{
|
||||||
|
return $this->label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setLabel(string $label): static
|
||||||
|
{
|
||||||
|
$this->label = $label;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIncidents(): Collection
|
||||||
|
{
|
||||||
|
return $this->incidents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setIncidents(Collection $incidents): void
|
||||||
|
{
|
||||||
|
$this->incidents = $incidents;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1 +1,152 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity]
|
||||||
|
class Mission
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 30)]
|
||||||
|
private ?string $label = null;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(targetEntity: Requirement::class, mappedBy: 'mission')]
|
||||||
|
#[ORM\JoinColumn(referencedColumnName: 'mission')]
|
||||||
|
private Collection $requirements;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(targetEntity: Employee::class, mappedBy: 'mission')]
|
||||||
|
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;
|
||||||
|
|
||||||
|
public function getRequirements(): Collection
|
||||||
|
{
|
||||||
|
return $this->requirements;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addRequirement(Requirement $requirement): static
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEmployeemissions(): Collection
|
||||||
|
{
|
||||||
|
return $this->employeemissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setEmployeemissions(Collection $employeemissions): void
|
||||||
|
{
|
||||||
|
$this->employeemissions = $employeemissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setId(int $id): static
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLabel(): ?string
|
||||||
|
{
|
||||||
|
return $this->label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setLabel(string $label): static
|
||||||
|
{
|
||||||
|
$this->label = $label;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEmployee(): ?employee
|
||||||
|
{
|
||||||
|
return $this->employee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setEmployee(?employee $employee): void
|
||||||
|
{
|
||||||
|
$this->employee = $employee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCategories(): Collection
|
||||||
|
{
|
||||||
|
return $this->categories;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCategories(Collection $categories): void
|
||||||
|
{
|
||||||
|
$this->categories = $categories;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRide(): ?Ride
|
||||||
|
{
|
||||||
|
return $this->ride;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setRide(?Ride $ride): void
|
||||||
|
{
|
||||||
|
$this->ride = $ride;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMissionCategorie(): Collection
|
||||||
|
{
|
||||||
|
return $this->missionCategories;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addMissionCategory(MissionCategory $missionCategory): static
|
||||||
|
{
|
||||||
|
if(!$this->missionCategories->contains($missionCategory)) {
|
||||||
|
$this->missionCategories->add($missionCategory);
|
||||||
|
$missionCategory->setMission($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeMissionCategory(MissionCategory $missionCategory): static
|
||||||
|
{
|
||||||
|
if($this->missionCategories->removeElement($missionCategory)) {
|
||||||
|
if($missionCategory->getMission() === $this) {
|
||||||
|
$missionCategory->setMission(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
43
src/Entity/MissionCategory.php
Normal file
43
src/Entity/MissionCategory.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\MissionCategoryRepository;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity]
|
||||||
|
#[ORM\UniqueConstraint(columns: ['mission', 'category'])]
|
||||||
|
class MissionCategory
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\ManyToOne(targetEntity: Mission::class, inversedBy: 'missionCategories')]
|
||||||
|
#[ORM\Column(type: 'integer')]
|
||||||
|
private ?Mission $mission = null;
|
||||||
|
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\ManyToOne(targetEntity: Category::class, inversedBy: 'missionCategories')]
|
||||||
|
#[ORM\Column(type: 'integer')]
|
||||||
|
private ?Category $category = null;
|
||||||
|
|
||||||
|
public function getMission(): ?Mission
|
||||||
|
{
|
||||||
|
return $this->mission;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setMission(?Mission $mission): void
|
||||||
|
{
|
||||||
|
$this->mission = $mission;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCategory(): ?Category
|
||||||
|
{
|
||||||
|
return $this->category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCategory(?Category $category): void
|
||||||
|
{
|
||||||
|
$this->category = $category;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
71
src/Entity/Representation.php
Normal file
71
src/Entity/Representation.php
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity]
|
||||||
|
#[ORM\UniqueConstraint(
|
||||||
|
columns: ['employee', 'ride']
|
||||||
|
)]
|
||||||
|
class Representation
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\ManyToOne(targetEntity: Employee::class, inversedBy: 'representations')]
|
||||||
|
#[ORM\Column(type: 'integer')]
|
||||||
|
private ?Employee $employee = null;
|
||||||
|
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\ManyToOne(targetEntity: Ride::class, inversedBy: 'representations')]
|
||||||
|
#[ORM\Column(type: 'integer')]
|
||||||
|
private ?Ride $ride = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $count = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?\DateTime $date = null;
|
||||||
|
|
||||||
|
public function getCount(): ?int
|
||||||
|
{
|
||||||
|
return $this->count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCount(?int $count): void
|
||||||
|
{
|
||||||
|
$this->count = $count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDate(): ?\DateTime
|
||||||
|
{
|
||||||
|
return $this->date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDate(?\DateTime $date): void
|
||||||
|
{
|
||||||
|
$this->date = $date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEmployee(): ?Employee
|
||||||
|
{
|
||||||
|
return $this->employee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setEmployee(?Employee $employee): void
|
||||||
|
{
|
||||||
|
$this->employee = $employee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRide(): ?Ride
|
||||||
|
{
|
||||||
|
return $this->ride;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setRide(?Ride $ride): void
|
||||||
|
{
|
||||||
|
$this->ride = $ride;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
43
src/Entity/Requirement.php
Normal file
43
src/Entity/Requirement.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity]
|
||||||
|
#[ORM\UniqueConstraint(
|
||||||
|
columns: ['mission', 'skill']
|
||||||
|
)]
|
||||||
|
class Requirement
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\ManyToOne(targetEntity: Mission::class, inversedBy: 'requirements')]
|
||||||
|
#[ORM\Column(type: 'integer')]
|
||||||
|
private ?Mission $mission = null;
|
||||||
|
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\ManyToOne(targetEntity: Skill::class, inversedBy: 'requirements')]
|
||||||
|
#[ORM\Column(type: 'integer')]
|
||||||
|
private ?Skill $skill = null;
|
||||||
|
|
||||||
|
public function getMission(): ?Mission
|
||||||
|
{
|
||||||
|
return $this->mission;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setMission(?Mission $mission): void
|
||||||
|
{
|
||||||
|
$this->mission = $mission;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSkill(): ?Skill
|
||||||
|
{
|
||||||
|
return $this->skill;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setSkill(?Skill $skill): void
|
||||||
|
{
|
||||||
|
$this->skill = $skill;
|
||||||
|
}
|
||||||
|
}
|
@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Entity;
|
|
||||||
|
|
||||||
use App\Repository\RequirementsRepository;
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
|
||||||
|
|
||||||
#[ORM\OneToMany(targetEntity: Mission::class, mappedBy: 'requirements')]
|
|
||||||
#[ORM\OneToMany(targetEntity: Skill::class, mappedBy: 'requirements')]
|
|
||||||
class Requirements
|
|
||||||
{
|
|
||||||
#[ORM\Id]
|
|
||||||
#[ORM\GeneratedValue]
|
|
||||||
#[ORM\Column]
|
|
||||||
private ?int $id = null;
|
|
||||||
|
|
||||||
public function getId(): ?int
|
|
||||||
{
|
|
||||||
return $this->id;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1 +1,145 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity]
|
||||||
|
class Ride
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 30)]
|
||||||
|
private ?string $label = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $count = null;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(targetEntity: Assignment::class, mappedBy: 'ride')]
|
||||||
|
#[ORM\JoinColumn(referencedColumnName: 'ride')]
|
||||||
|
private Collection $assignments;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(targetEntity: Representation::class, mappedBy: 'ride')]
|
||||||
|
#[ORM\JoinColumn(referencedColumnName: 'ride')]
|
||||||
|
private Collection $representations;
|
||||||
|
|
||||||
|
#[ORM\ManyToOne(targetEntity: IncidentType::class, inversedBy: 'ride')]
|
||||||
|
private Collection $incidentTypes;
|
||||||
|
|
||||||
|
#[ORM\ManyToOne(targetEntity: Mission::class, inversedBy: 'ride')]
|
||||||
|
private Collection $missions;
|
||||||
|
|
||||||
|
public function getAssignments(): Collection
|
||||||
|
{
|
||||||
|
return $this->assignments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addAssigment(Assignment $assignment): static
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRepresentations(): Collection
|
||||||
|
{
|
||||||
|
return $this->representations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addRepresentation(Representation $representation): static
|
||||||
|
{
|
||||||
|
if(!$this->representations->contains($representation)) {
|
||||||
|
$this->representations->add($representation);
|
||||||
|
$representation->setRide($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeRepresentation(Representation $representation): static
|
||||||
|
{
|
||||||
|
if($this->representations->removeElement($representation)) {
|
||||||
|
if($representation->getRide() === $this) {
|
||||||
|
$representation->setRide(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setId(int $id): static
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLabel(): ?string
|
||||||
|
{
|
||||||
|
return $this->label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setLabel(string $label): static
|
||||||
|
{
|
||||||
|
$this->label = $label;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCount(): ?int
|
||||||
|
{
|
||||||
|
return $this->count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCount(int $count): static
|
||||||
|
{
|
||||||
|
$this->count = $count;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIncidentTypes(): Collection
|
||||||
|
{
|
||||||
|
return $this->incidentTypes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setIncidentTypes(Collection $incidentTypes): void
|
||||||
|
{
|
||||||
|
$this->incidentTypes = $incidentTypes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMissions(): Collection
|
||||||
|
{
|
||||||
|
return $this->missions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setMissions(Collection $missions): void
|
||||||
|
{
|
||||||
|
$this->missions = $missions;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -1 +1,103 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity]
|
||||||
|
class Skill
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 30)]
|
||||||
|
private ?string $label = null;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(targetEntity: Requirement::class, mappedBy: 'skill')]
|
||||||
|
#[ORM\JoinColumn(referencedColumnName: 'skill')]
|
||||||
|
private Collection $requirements;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(targetEntity: EmployeeSkill::class, mappedBy: 'skill')]
|
||||||
|
#[ORM\JoinColumn(referencedColumnName: 'skill')]
|
||||||
|
private Collection $employeeSkills;
|
||||||
|
|
||||||
|
public function getRequirements(): Collection
|
||||||
|
{
|
||||||
|
return $this->requirements;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addRequirement(Requirement $requirement): static
|
||||||
|
{
|
||||||
|
if(!$this->requirements->contains($requirement)) {
|
||||||
|
$this->requirements->add($requirement);
|
||||||
|
$requirement->setSkill($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeRequirement(Requirement $requirement): static
|
||||||
|
{
|
||||||
|
if($this->requirements->removeElement($requirement)) {
|
||||||
|
if($requirement->getSkill() === $this) {
|
||||||
|
$requirement->setSkill(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setId(int $id): static
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLabel(): ?string
|
||||||
|
{
|
||||||
|
return $this->label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setLabel(string $label): static
|
||||||
|
{
|
||||||
|
$this->label = $label;
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
60
src/Repository/EmployeeRepository.php
Normal file
60
src/Repository/EmployeeRepository.php
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\Employee;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
|
||||||
|
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||||
|
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<Employee>
|
||||||
|
*/
|
||||||
|
class EmployeeRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Employee::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to upgrade (rehash) the user's password automatically over time.
|
||||||
|
*/
|
||||||
|
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
|
||||||
|
{
|
||||||
|
if (!$user instanceof Employee) {
|
||||||
|
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', $user::class));
|
||||||
|
}
|
||||||
|
|
||||||
|
$user->setPassword($newHashedPassword);
|
||||||
|
$this->getEntityManager()->persist($user);
|
||||||
|
$this->getEntityManager()->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return Employee[] Returns an array of Employee objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('e')
|
||||||
|
// ->andWhere('e.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('e.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?Employee
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('e')
|
||||||
|
// ->andWhere('e.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
43
src/Repository/MissionCategoryRepository.php
Normal file
43
src/Repository/MissionCategoryRepository.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\MissionCategory;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<MissionCategory>
|
||||||
|
*/
|
||||||
|
class MissionCategoryRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, MissionCategory::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return MissionCategory[] Returns an array of MissionCategory objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('m')
|
||||||
|
// ->andWhere('m.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('m.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?MissionCategory
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('m')
|
||||||
|
// ->andWhere('m.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
@ -12,6 +12,11 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% block body %}{% endblock %}
|
<header>
|
||||||
|
|
||||||
|
</header>
|
||||||
|
{% block body %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user