wallabag/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php

71 lines
2 KiB
PHP
Raw Normal View History

<?php
2018-11-26 19:00:01 +00:00
namespace Wallabag\CoreBundle\DataFixtures;
2018-11-26 19:00:01 +00:00
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Wallabag\CoreBundle\Entity\Config;
2018-11-26 19:00:01 +00:00
use Wallabag\UserBundle\DataFixtures\UserFixtures;
2018-11-26 19:00:01 +00:00
class ConfigFixtures extends Fixture implements DependentFixtureInterface
{
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager)
{
$adminConfig = new Config($this->getReference('admin-user'));
2015-11-13 20:23:39 +00:00
2015-08-04 20:51:21 +00:00
$adminConfig->setTheme('material');
$adminConfig->setItemsPerPage(30);
2016-03-08 15:48:30 +00:00
$adminConfig->setReadingSpeed(1);
2015-12-29 08:59:46 +00:00
$adminConfig->setLanguage('en');
2016-09-16 20:22:25 +00:00
$adminConfig->setPocketConsumerKey('xxxxx');
$adminConfig->setActionMarkAsRead(0);
2016-12-12 16:41:03 +00:00
$adminConfig->setListMode(0);
$manager->persist($adminConfig);
$this->addReference('admin-config', $adminConfig);
$bobConfig = new Config($this->getReference('bob-user'));
$bobConfig->setTheme('default');
$bobConfig->setItemsPerPage(10);
2016-03-08 15:48:30 +00:00
$bobConfig->setReadingSpeed(1);
2015-12-29 08:59:46 +00:00
$bobConfig->setLanguage('fr');
2016-09-16 20:22:25 +00:00
$bobConfig->setPocketConsumerKey(null);
$bobConfig->setActionMarkAsRead(1);
2016-12-12 16:41:03 +00:00
$bobConfig->setListMode(1);
$manager->persist($bobConfig);
$this->addReference('bob-config', $bobConfig);
2016-01-09 13:34:49 +00:00
$emptyConfig = new Config($this->getReference('empty-user'));
$emptyConfig->setTheme('material');
$emptyConfig->setItemsPerPage(10);
2016-03-08 15:48:30 +00:00
$emptyConfig->setReadingSpeed(1);
2016-01-09 13:34:49 +00:00
$emptyConfig->setLanguage('en');
2016-09-16 20:22:25 +00:00
$emptyConfig->setPocketConsumerKey(null);
$emptyConfig->setActionMarkAsRead(0);
2016-12-12 16:41:03 +00:00
$emptyConfig->setListMode(0);
2016-01-09 13:34:49 +00:00
$manager->persist($emptyConfig);
$this->addReference('empty-config', $emptyConfig);
$manager->flush();
}
/**
* {@inheritdoc}
*/
2018-11-26 19:00:01 +00:00
public function getDependencies()
{
2018-11-26 19:00:01 +00:00
return [
UserFixtures::class,
];
}
}