3 namespace Wallabag\CoreBundle\DataFixtures
;
5 use Doctrine\Bundle\FixturesBundle\Fixture
;
6 use Doctrine\Common\DataFixtures\DependentFixtureInterface
;
7 use Doctrine\Common\Persistence\ObjectManager
;
8 use Symfony\Component\DependencyInjection\ContainerAwareInterface
;
9 use Symfony\Component\DependencyInjection\ContainerInterface
;
10 use Wallabag\CoreBundle\Entity\SiteCredential
;
11 use Wallabag\UserBundle\DataFixtures\UserFixtures
;
13 class SiteCredentialFixtures
extends Fixture
implements DependentFixtureInterface
, ContainerAwareInterface
16 * @var ContainerInterface
20 public function setContainer(ContainerInterface
$container = null)
22 $this->container
= $container;
28 public function load(ObjectManager
$manager)
30 $credential = new SiteCredential($this->getReference('admin-user'));
31 $credential->setHost('.super.com');
32 $credential->setUsername($this->container
->get('wallabag_core.helper.crypto_proxy')->crypt('.super'));
33 $credential->setPassword($this->container
->get('wallabag_core.helper.crypto_proxy')->crypt('bar'));
35 $manager->persist($credential);
37 $credential = new SiteCredential($this->getReference('admin-user'));
38 $credential->setHost('paywall.example.com');
39 $credential->setUsername($this->container
->get('wallabag_core.helper.crypto_proxy')->crypt('paywall.example'));
40 $credential->setPassword($this->container
->get('wallabag_core.helper.crypto_proxy')->crypt('bar'));
42 $manager->persist($credential);
50 public function getDependencies()