2018-11-23 22:09:29 +01:00
|
|
|
<?php
|
|
|
|
|
2019-02-17 14:33:19 +01:00
|
|
|
namespace Infinito\DataFixtures;
|
2018-11-23 22:09:29 +01:00
|
|
|
|
|
|
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
|
|
|
use Doctrine\Common\Persistence\ObjectManager;
|
2019-02-17 14:33:19 +01:00
|
|
|
use Infinito\Domain\FixtureManagement\FixtureSourceFactory;
|
2018-11-23 22:09:29 +01:00
|
|
|
|
2019-01-01 22:36:55 +01:00
|
|
|
/**
|
|
|
|
* @author kevinfrantz
|
|
|
|
*/
|
2018-11-23 22:09:29 +01:00
|
|
|
class SourceFixtures extends Fixture
|
|
|
|
{
|
2019-01-03 21:04:48 +01:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*
|
|
|
|
* @see \Doctrine\Common\DataFixtures\FixtureInterface::load()
|
|
|
|
*/
|
2018-11-23 22:09:29 +01:00
|
|
|
public function load(ObjectManager $manager)
|
|
|
|
{
|
2019-02-02 23:02:28 +01:00
|
|
|
$fixtureSources = FixtureSourceFactory::getAllFixtureSources();
|
|
|
|
foreach ($fixtureSources as $fixtureSource) {
|
|
|
|
$manager->persist($fixtureSource->getORMReadyObject());
|
|
|
|
}
|
2018-11-23 22:09:29 +01:00
|
|
|
$manager->flush();
|
|
|
|
}
|
|
|
|
}
|