Created
March 23, 2012 08:03
-
-
Save Axxiss/2168158 to your computer and use it in GitHub Desktop.
Fixture definition
This file contains 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
class LoadMediaData extends AbstractFixture implements OrderedFixtureInterface | |
{ | |
public function load(ObjectManager $manager) | |
{ | |
$certification = new Certification(); | |
$certification->setCode('PG-13'); | |
$manager->persist($certification); | |
$person = new Person(); | |
$person->setName('Test person'); | |
$manager->persist($person); | |
$movie = new Movie(); | |
$movie->setOriginalName('Test movie'); | |
$manager->persist($movie); | |
$cast = new MovieHasPerson(); | |
$cast->setPerson($person); | |
$cast->setMovie($movie); | |
$cast->setCharacterName('Test name'); | |
$manager->persist($cast); | |
$manager->flush(); | |
$this->addReference('movie-test', $movie); | |
} | |
public function getOrder() | |
{ | |
return 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixture example