Ajout des notification + page employé (#6)
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
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>
This commit was merged in pull request #6.
This commit is contained in:
71
src/DataFixtures/EmployeeFixtures.php
Normal file
71
src/DataFixtures/EmployeeFixtures.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\Contract;
|
||||
use App\Entity\Employee;
|
||||
use App\Entity\Site;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
final class EmployeeFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$site = $this->getReference(FixtureReferences::SITE_MAIN, Site::class);
|
||||
|
||||
$employeeStandard = new Employee()
|
||||
->setFirstName('Alice')
|
||||
->setLastName('Martin')
|
||||
->setSite($site)
|
||||
->setContract($this->getReference(FixtureReferences::CONTRACT_35, Contract::class))
|
||||
->setDisplayOrder(1)
|
||||
;
|
||||
|
||||
$employee4h = new Employee()
|
||||
->setFirstName('Bruno')
|
||||
->setLastName('Petit')
|
||||
->setSite($site)
|
||||
->setContract($this->getReference(FixtureReferences::CONTRACT_4H, Contract::class))
|
||||
->setDisplayOrder(2)
|
||||
;
|
||||
|
||||
$employeeForfait = new Employee()
|
||||
->setFirstName('Chloe')
|
||||
->setLastName('Durand')
|
||||
->setSite($site)
|
||||
->setContract($this->getReference(FixtureReferences::CONTRACT_FORFAIT, Contract::class))
|
||||
->setDisplayOrder(3)
|
||||
;
|
||||
|
||||
$employeeInterim = new Employee()
|
||||
->setFirstName('David')
|
||||
->setLastName('Leroy')
|
||||
->setSite($site)
|
||||
->setContract($this->getReference(FixtureReferences::CONTRACT_INTERIM, Contract::class))
|
||||
->setDisplayOrder(4)
|
||||
;
|
||||
|
||||
$manager->persist($employeeStandard);
|
||||
$manager->persist($employee4h);
|
||||
$manager->persist($employeeForfait);
|
||||
$manager->persist($employeeInterim);
|
||||
$manager->flush();
|
||||
|
||||
$this->addReference(FixtureReferences::EMPLOYEE_STANDARD, $employeeStandard);
|
||||
$this->addReference(FixtureReferences::EMPLOYEE_4H, $employee4h);
|
||||
$this->addReference(FixtureReferences::EMPLOYEE_FORFAIT, $employeeForfait);
|
||||
$this->addReference(FixtureReferences::EMPLOYEE_INTERIM, $employeeInterim);
|
||||
}
|
||||
|
||||
public function getDependencies(): array
|
||||
{
|
||||
return [
|
||||
SiteFixtures::class,
|
||||
ContractFixtures::class,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user