wallabag/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php

38 lines
908 B
PHP
Raw Normal View History

<?php
2018-11-26 19:00:01 +00:00
namespace Wallabag\CoreBundle\DataFixtures;
2018-11-26 19:00:01 +00:00
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Wallabag\CoreBundle\Entity\SiteCredential;
2018-11-26 19:00:01 +00:00
use Wallabag\UserBundle\DataFixtures\UserFixtures;
2018-11-26 19:00:01 +00:00
class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface
{
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager)
{
$credential = new SiteCredential($this->getReference('admin-user'));
$credential->setHost('example.com');
$credential->setUsername('foo');
$credential->setPassword('bar');
$manager->persist($credential);
$manager->flush();
}
/**
* {@inheritdoc}
*/
2018-11-26 19:00:01 +00:00
public function getDependencies()
{
2018-11-26 19:00:01 +00:00
return [
UserFixtures::class,
];
}
}