Finalisation réception marchandise, ajout de composant UI et ajout de fixtures (!7)
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [x] Pas de régression - [ ] TU/TI/TF rédigée - [x] TU/TI/TF OK - [x] CHANGELOG modifié Reviewed-on: https://gitea.malio.fr/MALIO-DEV/Ferme/pulls/7 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\Building;
|
||||
use App\Entity\MerchandiseType;
|
||||
use App\Entity\PelletType;
|
||||
use App\Entity\ReceptionType;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
class ReferenceFixtures extends Fixture
|
||||
{
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$merchandiseTypes = [
|
||||
['label' => 'Foin', 'code' => 'FOIN'],
|
||||
['label' => 'Paille', 'code' => 'PAILLE'],
|
||||
['label' => 'Granule', 'code' => 'GRANULE'],
|
||||
];
|
||||
foreach ($merchandiseTypes as $type) {
|
||||
$merchandiseType = new MerchandiseType()
|
||||
->setLabel($type['label'])
|
||||
->setCode($type['code'])
|
||||
;
|
||||
$manager->persist($merchandiseType);
|
||||
}
|
||||
|
||||
$pelletTypes = [
|
||||
['label' => 'JB croissance', 'code' => 'K750'],
|
||||
['label' => 'Genisse herbe', 'code' => 'K500'],
|
||||
['label' => 'Bovistart melasse ferme', 'code' => 'K130'],
|
||||
['label' => 'Bovin mise en forme', 'code' => 'K400'],
|
||||
];
|
||||
foreach ($pelletTypes as $type) {
|
||||
$pelletType = new PelletType()
|
||||
->setLabel($type['label'])
|
||||
->setCode($type['code'])
|
||||
;
|
||||
$manager->persist($pelletType);
|
||||
}
|
||||
|
||||
$buildings = [
|
||||
['label' => 'Bâtiment 1', 'code' => 'B1'],
|
||||
['label' => 'Bâtiment 2', 'code' => 'B2'],
|
||||
['label' => 'Bâtiment 3', 'code' => 'B3'],
|
||||
];
|
||||
foreach ($buildings as $buildingData) {
|
||||
$building = new Building()
|
||||
->setLabel($buildingData['label'])
|
||||
->setCode($buildingData['code'])
|
||||
;
|
||||
$manager->persist($building);
|
||||
}
|
||||
|
||||
$receptionTypes = [
|
||||
['label' => 'Marchandises', 'code' => 'MARCHANDISES'],
|
||||
['label' => 'Bovins', 'code' => 'BOVINS'],
|
||||
];
|
||||
foreach ($receptionTypes as $type) {
|
||||
$receptionType = new ReceptionType()
|
||||
->setLabel($type['label'])
|
||||
->setCode($type['code'])
|
||||
;
|
||||
$manager->persist($receptionType);
|
||||
}
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user