infinito/application/symfony/src/DataFixtures/SourceFixtures.php

28 lines
658 B
PHP
Raw Normal View History

2018-11-23 22:09:29 +01:00
<?php
namespace Infinito\DataFixtures;
2018-11-23 22:09:29 +01:00
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
use Infinito\Domain\Fixture\FixtureSourceFactory;
2018-11-23 22:09:29 +01:00
/**
* @author kevinfrantz
*/
2018-11-23 22:09:29 +01:00
class SourceFixtures extends Fixture
{
/**
* {@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();
}
}