]>
Commit | Line | Data |
---|---|---|
b8427f22 JB |
1 | <?php |
2 | ||
db9b6d8d | 3 | namespace Wallabag\CoreBundle\DataFixtures; |
b8427f22 | 4 | |
db9b6d8d JB |
5 | use Doctrine\Bundle\FixturesBundle\Fixture; |
6 | use Doctrine\Common\DataFixtures\DependentFixtureInterface; | |
b8427f22 JB |
7 | use Doctrine\Common\Persistence\ObjectManager; |
8 | use Wallabag\CoreBundle\Entity\SiteCredential; | |
db9b6d8d | 9 | use Wallabag\UserBundle\DataFixtures\UserFixtures; |
b8427f22 | 10 | |
db9b6d8d | 11 | class 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 | } |