You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
animegame/src/DataFixtures/HeroFixtures.php

30 lines
680 B

<?php
namespace App\DataFixtures;
use App\Entity\Hero;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
class HeroFixtures extends Fixture implements DependentFixtureInterface
{
public function load(ObjectManager $manager)
{
$hero = new Hero();
$hero->setName('ruffy');
$hero->setUser($this->getReference(UserFixtures::ADMIN_USER_REFERENCE));
$manager->persist($hero);
$manager->flush();
}
public function getDependencies()
{
return array(
UserFixtures::class,
);
}
}