mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-10 14:27:28 +01:00
28 lines
658 B
PHP
28 lines
658 B
PHP
<?php
|
|
|
|
namespace Infinito\DataFixtures;
|
|
|
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
|
use Doctrine\Common\Persistence\ObjectManager;
|
|
use Infinito\Domain\Fixture\FixtureSourceFactory;
|
|
|
|
/**
|
|
* @author kevinfrantz
|
|
*/
|
|
class SourceFixtures extends Fixture
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*
|
|
* @see \Doctrine\Common\DataFixtures\FixtureInterface::load()
|
|
*/
|
|
public function load(ObjectManager $manager)
|
|
{
|
|
$fixtureSources = FixtureSourceFactory::getAllFixtureSources();
|
|
foreach ($fixtureSources as $fixtureSource) {
|
|
$manager->persist($fixtureSource->getORMReadyObject());
|
|
}
|
|
$manager->flush();
|
|
}
|
|
}
|