ajout fixtures et styles
This commit is contained in:
22
src/DataFixtures/DonCatFixtures.php
Normal file
22
src/DataFixtures/DonCatFixtures.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\DonCat;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
|
||||
class DonCatFixtures extends Fixture
|
||||
{
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$donCat1 = (new DonCat())->setName('cat1');
|
||||
$manager->persist($donCat1);
|
||||
$donCat2 = (new DonCat())->setName('cat2');
|
||||
$manager->persist($donCat2);
|
||||
$donCat3 = (new DonCat())->setName('cat3');
|
||||
$manager->persist($donCat3);
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user