2015-02-08 23:05:51 +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\User;
|
|
|
|
|
|
|
|
class LoadUserData extends AbstractFixture implements OrderedFixtureInterface
|
|
|
|
{
|
|
|
|
/**
|
2015-08-20 07:53:55 +02:00
|
|
|
* {@inheritdoc}
|
2015-02-08 23:05:51 +01:00
|
|
|
*/
|
|
|
|
public function load(ObjectManager $manager)
|
|
|
|
{
|
|
|
|
$userAdmin = new User();
|
2015-02-10 22:32:42 +01:00
|
|
|
$userAdmin->setName('Big boss');
|
|
|
|
$userAdmin->setEmail('bigboss@wallabag.org');
|
2015-02-08 23:05:51 +01:00
|
|
|
$userAdmin->setUsername('admin');
|
2015-02-17 21:03:23 +01:00
|
|
|
$userAdmin->setPassword('mypassword');
|
2015-02-08 23:05:51 +01:00
|
|
|
|
|
|
|
$manager->persist($userAdmin);
|
|
|
|
|
|
|
|
$this->addReference('admin-user', $userAdmin);
|
2015-02-10 22:32:42 +01:00
|
|
|
|
|
|
|
$bobUser = new User();
|
|
|
|
$bobUser->setName('Bobby');
|
|
|
|
$bobUser->setEmail('bobby@wallabag.org');
|
|
|
|
$bobUser->setUsername('bob');
|
2015-02-17 21:03:23 +01:00
|
|
|
$bobUser->setPassword('mypassword');
|
2015-02-10 22:32:42 +01:00
|
|
|
|
|
|
|
$manager->persist($bobUser);
|
|
|
|
|
|
|
|
$this->addReference('bob-user', $bobUser);
|
|
|
|
|
|
|
|
$manager->flush();
|
2015-02-08 23:05:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-08-20 07:53:55 +02:00
|
|
|
* {@inheritdoc}
|
2015-02-08 23:05:51 +01:00
|
|
|
*/
|
|
|
|
public function getOrder()
|
|
|
|
{
|
|
|
|
return 10;
|
|
|
|
}
|
|
|
|
}
|