aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2017-06-20 16:40:48 +0200
committerGitHub <noreply@github.com>2017-06-20 16:40:48 +0200
commit80784b782becfaa297e6d9cbb0584e27739cffc8 (patch)
treefc201969597b16070d890b0703568618a81a76bc /src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php
parent604cca1f4247f9f905e57b9276cf2543cfa41a5d (diff)
parentf44dba22fc1a566cb156d9e6eda5afc353163eda (diff)
downloadwallabag-80784b782becfaa297e6d9cbb0584e27739cffc8.tar.gz
wallabag-80784b782becfaa297e6d9cbb0584e27739cffc8.tar.zst
wallabag-80784b782becfaa297e6d9cbb0584e27739cffc8.zip
Merge pull request #2683 from wallabag/credentials-in-db
Store credentials in DB
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php')
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php
new file mode 100644
index 00000000..866f55a4
--- /dev/null
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php
@@ -0,0 +1,34 @@
1<?php
2
3namespace Wallabag\CoreBundle\DataFixtures\ORM;
4
5use Doctrine\Common\DataFixtures\AbstractFixture;
6use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
7use Doctrine\Common\Persistence\ObjectManager;
8use Wallabag\CoreBundle\Entity\SiteCredential;
9
10class LoadSiteCredentialData extends AbstractFixture implements OrderedFixtureInterface
11{
12 /**
13 * {@inheritdoc}
14 */
15 public function load(ObjectManager $manager)
16 {
17 $credential = new SiteCredential($this->getReference('admin-user'));
18 $credential->setHost('example.com');
19 $credential->setUsername('foo');
20 $credential->setPassword('bar');
21
22 $manager->persist($credential);
23
24 $manager->flush();
25 }
26
27 /**
28 * {@inheritdoc}
29 */
30 public function getOrder()
31 {
32 return 50;
33 }
34}