2015-02-22 13:35:36 +00:00
|
|
|
<?php
|
|
|
|
|
2018-11-26 19:00:01 +00:00
|
|
|
namespace Wallabag\CoreBundle\DataFixtures;
|
2015-02-22 13:35:36 +00:00
|
|
|
|
2018-11-26 19:00:01 +00:00
|
|
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
|
|
|
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
2015-02-22 13:35:36 +00:00
|
|
|
use Doctrine\Common\Persistence\ObjectManager;
|
|
|
|
use Wallabag\CoreBundle\Entity\Config;
|
2018-11-26 19:00:01 +00:00
|
|
|
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
2015-02-22 13:35:36 +00:00
|
|
|
|
2018-11-26 19:00:01 +00:00
|
|
|
class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
2015-02-22 13:35:36 +00:00
|
|
|
{
|
|
|
|
/**
|
2015-08-20 05:53:55 +00:00
|
|
|
* {@inheritdoc}
|
2015-02-22 13:35:36 +00:00
|
|
|
*/
|
|
|
|
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');
|
2015-02-22 13:35:36 +00:00
|
|
|
$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');
|
2016-11-06 11:02:39 +00:00
|
|
|
$adminConfig->setActionMarkAsRead(0);
|
2016-12-12 16:41:03 +00:00
|
|
|
$adminConfig->setListMode(0);
|
2015-02-22 13:35:36 +00: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 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);
|
2016-11-06 11:02:39 +00:00
|
|
|
$bobConfig->setActionMarkAsRead(1);
|
2016-12-12 16:41:03 +00:00
|
|
|
$bobConfig->setListMode(1);
|
2015-02-22 13:35:36 +00:00
|
|
|
|
|
|
|
$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);
|
2016-11-06 11:02:39 +00:00
|
|
|
$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);
|
|
|
|
|
2015-02-22 13:35:36 +00:00
|
|
|
$manager->flush();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-08-20 05:53:55 +00:00
|
|
|
* {@inheritdoc}
|
2015-02-22 13:35:36 +00:00
|
|
|
*/
|
2018-11-26 19:00:01 +00:00
|
|
|
public function getDependencies()
|
2015-02-22 13:35:36 +00:00
|
|
|
{
|
2018-11-26 19:00:01 +00:00
|
|
|
return [
|
|
|
|
UserFixtures::class,
|
|
|
|
];
|
2015-02-22 13:35:36 +00:00
|
|
|
}
|
|
|
|
}
|