for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* /core/app fixtures for mongodb app collection.
*/
namespace Graviton\I18nBundle\DataFixtures\MongoDB;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Graviton\I18nBundle\Document\Language;
* Load Language data fixtures into mongodb
*
* @author List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @link http://swisscom.ch
class LoadMultiLanguageData implements FixtureInterface
{
* {@inheritDoc}
* @param ObjectManager $manager Object Manager
* @return void
public function load(ObjectManager $manager)
foreach (['de' => 'German', 'fr' => 'French'] as $id => $name) {
$lang = new Language;
$lang->setId($id);
$lang->setName($name);
$manager->persist($lang);
}
$manager->flush();