diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-05-01 22:13:35 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-06-20 16:03:14 +0200 |
commit | b8427f22f06cab58383ec3080f09715c712c65ef (patch) | |
tree | 0f71278c3296774f86cba8cf4381f9aa4f9b3086 /src/Wallabag/CoreBundle/DataFixtures | |
parent | 5a9bc00726ddaf7c8798d4932d0a8b7a38422670 (diff) | |
download | wallabag-b8427f22f06cab58383ec3080f09715c712c65ef.tar.gz wallabag-b8427f22f06cab58383ec3080f09715c712c65ef.tar.zst wallabag-b8427f22f06cab58383ec3080f09715c712c65ef.zip |
Add menu access to site credentials CRUD
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures')
-rw-r--r-- | src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php | 34 |
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 | |||
3 | namespace Wallabag\CoreBundle\DataFixtures\ORM; | ||
4 | |||
5 | use Doctrine\Common\DataFixtures\AbstractFixture; | ||
6 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | ||
7 | use Doctrine\Common\Persistence\ObjectManager; | ||
8 | use Wallabag\CoreBundle\Entity\SiteCredential; | ||
9 | |||
10 | class 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 | } | ||