Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [ ] Pas de régression - [ ] TU/TI/TF rédigée - [ ] TU/TI/TF OK - [ ] CHANGELOG modifié Reviewed-on: #6 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
40 lines
1.5 KiB
PHP
40 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\DataFixtures;
|
|
|
|
use App\Entity\AbsenceType;
|
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
|
use Doctrine\Persistence\ObjectManager;
|
|
|
|
final class AbsenceTypeFixtures extends Fixture
|
|
{
|
|
public function load(ObjectManager $manager): void
|
|
{
|
|
$definitions = [
|
|
[FixtureReferences::ABSENCE_TYPE_RTT, 'R', 'RTT', '#feba01', false],
|
|
[FixtureReferences::ABSENCE_TYPE_CONGE, 'C', 'CONGÉ', '#008000', true],
|
|
[FixtureReferences::ABSENCE_TYPE_MALADIE, 'M', 'MALADIE', '#ed07da', true],
|
|
[FixtureReferences::ABSENCE_TYPE_AT, 'AT', 'ACCIDENT DE TRAVAIL', '#e41111', true],
|
|
[FixtureReferences::ABSENCE_TYPE_FORMATION, 'F', 'FORMATION', '#6c72e0', true],
|
|
[FixtureReferences::ABSENCE_TYPE_EXCEPTIONNEL, 'EX', 'CONGE EXCEPTIONNEL', '#8834ae', true],
|
|
[FixtureReferences::ABSENCE_TYPE_ABSENT, 'ABS', 'ABSENT', '#823a21', false],
|
|
[FixtureReferences::ABSENCE_TYPE_AUTRE, 'AUT', 'AUTRE', '#f07d60', true],
|
|
];
|
|
|
|
foreach ($definitions as [$reference, $code, $label, $color, $countAsWorkedHours]) {
|
|
$absenceType = new AbsenceType()
|
|
->setCode($code)
|
|
->setLabel($label)
|
|
->setColor($color)
|
|
->setCountAsWorkedHours($countAsWorkedHours)
|
|
;
|
|
$manager->persist($absenceType);
|
|
$this->addReference($reference, $absenceType);
|
|
}
|
|
|
|
$manager->flush();
|
|
}
|
|
}
|