2015-02-22 14:35:36 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Wallabag\CoreBundle\DataFixtures\ORM;
|
|
|
|
|
|
|
|
use Doctrine\Common\DataFixtures\AbstractFixture;
|
|
|
|
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
|
|
|
use Doctrine\Common\Persistence\ObjectManager;
|
|
|
|
use Wallabag\CoreBundle\Entity\Config;
|
|
|
|
|
|
|
|
class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
|
|
|
|
{
|
|
|
|
/**
|
2015-08-20 07:53:55 +02:00
|
|
|
* {@inheritdoc}
|
2015-02-22 14:35:36 +01:00
|
|
|
*/
|
|
|
|
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');
|
2015-02-22 14:35:36 +01:00
|
|
|
$adminConfig->setItemsPerPage(30);
|
2016-03-08 16:48:30 +01:00
|
|
|
$adminConfig->setReadingSpeed(1);
|
2015-12-29 09:59:46 +01:00
|
|
|
$adminConfig->setLanguage('en');
|
2016-09-16 22:22:25 +02:00
|
|
|
$adminConfig->setPocketConsumerKey('xxxxx');
|
2016-11-06 12:02:39 +01:00
|
|
|
$adminConfig->setActionMarkAsRead(0);
|
2016-12-12 17:41:03 +01:00
|
|
|
$adminConfig->setListMode(0);
|
2015-02-22 14:35:36 +01:00
|
|
|
|
|
|
|
$manager->persist($adminConfig);
|
|
|
|
|
|
|
|
$this->addReference('admin-config', $adminConfig);
|
|
|
|
|
|
|
|
$bobConfig = new Config($this->getReference('bob-user'));
|
|
|
|
$bobConfig->setTheme('default');
|
|
|
|
$bobConfig->setItemsPerPage(10);
|
2016-03-08 16:48:30 +01:00
|
|
|
$bobConfig->setReadingSpeed(1);
|
2015-12-29 09:59:46 +01:00
|
|
|
$bobConfig->setLanguage('fr');
|
2016-09-16 22:22:25 +02:00
|
|
|
$bobConfig->setPocketConsumerKey(null);
|
2016-11-06 12:02:39 +01:00
|
|
|
$bobConfig->setActionMarkAsRead(1);
|
2016-12-12 17:41:03 +01:00
|
|
|
$bobConfig->setListMode(1);
|
2015-02-22 14:35:36 +01:00
|
|
|
|
|
|
|
$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);
|
2016-03-08 16:48:30 +01:00
|
|
|
$emptyConfig->setReadingSpeed(1);
|
2016-01-09 14:34:49 +01:00
|
|
|
$emptyConfig->setLanguage('en');
|
2016-09-16 22:22:25 +02:00
|
|
|
$emptyConfig->setPocketConsumerKey(null);
|
2016-11-06 12:02:39 +01:00
|
|
|
$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);
|
|
|
|
|
2015-02-22 14:35:36 +01:00
|
|
|
$manager->flush();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-08-20 07:53:55 +02:00
|
|
|
* {@inheritdoc}
|
2015-02-22 14:35:36 +01:00
|
|
|
*/
|
|
|
|
public function getOrder()
|
|
|
|
{
|
|
|
|
return 20;
|
|
|
|
}
|
|
|
|
}
|