Skip to content

Instantly share code, notes, and snippets.

@Axxiss
Created March 23, 2012 08:03
Show Gist options
  • Save Axxiss/2168158 to your computer and use it in GitHub Desktop.
Save Axxiss/2168158 to your computer and use it in GitHub Desktop.
Fixture definition
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;
}
}
@Axxiss
Copy link
Author

Axxiss commented Mar 23, 2012

Fixture example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment