]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php
Update messages.pl.yml
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / DataFixtures / SiteCredentialFixtures.php
CommitLineData
b8427f22
JB
1<?php
2
db9b6d8d 3namespace Wallabag\CoreBundle\DataFixtures;
b8427f22 4
db9b6d8d
JB
5use Doctrine\Bundle\FixturesBundle\Fixture;
6use Doctrine\Common\DataFixtures\DependentFixtureInterface;
b8427f22
JB
7use Doctrine\Common\Persistence\ObjectManager;
8use Wallabag\CoreBundle\Entity\SiteCredential;
db9b6d8d 9use Wallabag\UserBundle\DataFixtures\UserFixtures;
b8427f22 10
db9b6d8d 11class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface
b8427f22
JB
12{
13 /**
14 * {@inheritdoc}
15 */
16 public function load(ObjectManager $manager)
17 {
18 $credential = new SiteCredential($this->getReference('admin-user'));
19 $credential->setHost('example.com');
20 $credential->setUsername('foo');
21 $credential->setPassword('bar');
22
23 $manager->persist($credential);
24
25 $manager->flush();
26 }
27
28 /**
29 * {@inheritdoc}
30 */
db9b6d8d 31 public function getDependencies()
b8427f22 32 {
db9b6d8d
JB
33 return [
34 UserFixtures::class,
35 ];
b8427f22
JB
36 }
37}