EthikTag/src/DataFixtures/DonCatFixtures.php

22 lines
546 B
PHP

<?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();
}
}