wallabag/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php
2018-11-28 22:04:54 +01:00

37 lines
908 B
PHP

<?php
namespace Wallabag\CoreBundle\DataFixtures;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Wallabag\CoreBundle\Entity\SiteCredential;
use Wallabag\UserBundle\DataFixtures\UserFixtures;
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}
*/
public function getDependencies()
{
return [
UserFixtures::class,
];
}
}