2017-05-01 20:13:35 +00:00
|
|
|
<?php
|
|
|
|
|
2018-11-26 19:00:01 +00:00
|
|
|
namespace Wallabag\CoreBundle\DataFixtures;
|
2017-05-01 20:13:35 +00:00
|
|
|
|
2018-11-26 19:00:01 +00:00
|
|
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
|
|
|
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
2017-05-01 20:13:35 +00:00
|
|
|
use Doctrine\Common\Persistence\ObjectManager;
|
|
|
|
use Wallabag\CoreBundle\Entity\SiteCredential;
|
2018-11-26 19:00:01 +00:00
|
|
|
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
2017-05-01 20:13:35 +00:00
|
|
|
|
2018-11-26 19:00:01 +00:00
|
|
|
class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface
|
2017-05-01 20:13:35 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* {@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()
|
2017-05-01 20:13:35 +00:00
|
|
|
{
|
2018-11-26 19:00:01 +00:00
|
|
|
return [
|
|
|
|
UserFixtures::class,
|
|
|
|
];
|
2017-05-01 20:13:35 +00:00
|
|
|
}
|
|
|
|
}
|