Created
August 22, 2020 20:00
-
-
Save 5quinque/aaa64e48210a16815b9224a8288d0e8f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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