Skip to content

Instantly share code, notes, and snippets.

@5quinque
Created August 22, 2020 20:00
Show Gist options
  • Save 5quinque/aaa64e48210a16815b9224a8288d0e8f to your computer and use it in GitHub Desktop.
Save 5quinque/aaa64e48210a16815b9224a8288d0e8f to your computer and use it in GitHub Desktop.
<?php
namespace App\DataFixtures;
use App\Entity\Board;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
class BoardFixtures extends Fixture
{
public function load(ObjectManager $manager)
{
$admin = $this->getReference(UserFixtures::ADMIN_USER_REFERENCE);
$board = new Board();
$board->setName('miscellaneous');
$board->setOwner($admin);
$manager->persist($board);
$manager->flush();
}
public function getDependencies()
{
return array(
UserFixtures::class,
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment