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>
56 lines
1.5 KiB
PHP
56 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\DataFixtures;
|
|
|
|
use App\Entity\Contract;
|
|
use App\Enum\TrackingMode;
|
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
|
use Doctrine\Persistence\ObjectManager;
|
|
|
|
final class ContractFixtures extends Fixture
|
|
{
|
|
public function load(ObjectManager $manager): void
|
|
{
|
|
$contract35 = new Contract()
|
|
->setName('35h')
|
|
->setTrackingMode(TrackingMode::TIME)
|
|
->setWeeklyHours(35)
|
|
->setIsActive(true)
|
|
;
|
|
|
|
$contract4h = new Contract()
|
|
->setName('4h')
|
|
->setTrackingMode(TrackingMode::TIME)
|
|
->setWeeklyHours(4)
|
|
->setIsActive(true)
|
|
;
|
|
|
|
$forfait = new Contract()
|
|
->setName('Forfait')
|
|
->setTrackingMode(TrackingMode::PRESENCE)
|
|
->setWeeklyHours(null)
|
|
->setIsActive(true)
|
|
;
|
|
|
|
$interim = new Contract()
|
|
->setName('Interim')
|
|
->setTrackingMode(TrackingMode::TIME)
|
|
->setWeeklyHours(35)
|
|
->setIsActive(true)
|
|
;
|
|
|
|
$manager->persist($contract35);
|
|
$manager->persist($contract4h);
|
|
$manager->persist($forfait);
|
|
$manager->persist($interim);
|
|
$manager->flush();
|
|
|
|
$this->addReference(FixtureReferences::CONTRACT_35, $contract35);
|
|
$this->addReference(FixtureReferences::CONTRACT_4H, $contract4h);
|
|
$this->addReference(FixtureReferences::CONTRACT_FORFAIT, $forfait);
|
|
$this->addReference(FixtureReferences::CONTRACT_INTERIM, $interim);
|
|
}
|
|
}
|