71 lines
2.0 KiB
PHP
Raw Normal View History

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