Prepare for moving into monorepo

This commit is contained in:
2021-03-18 12:46:42 +01:00
parent 354a202d06
commit 5a2551ac4f
717 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
<?php
namespace Chill\MainBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Doctrine\Persistence\ObjectManager;
use Chill\MainBundle\Command\LoadCountriesCommand;
/**
* Load countries into database
*
* @author Julien Fastré <julien arobase fastre point info>
*/
class LoadCountries extends AbstractFixture implements ContainerAwareInterface, OrderedFixtureInterface {
/**
*
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
public function getOrder() {
return 20;
}
public function load(ObjectManager $manager) {
echo "loading countries... \n";
$languages = $this->container->getParameter('chill_main.available_languages');
foreach (LoadCountriesCommand::prepareCountryList($languages) as $country){
$manager->persist($country);
}
$manager->flush();
}
}