3 namespace Wallabag\CoreBundle\DataFixtures\ORM
;
5 use Doctrine\Common\DataFixtures\AbstractFixture
;
6 use Doctrine\Common\DataFixtures\OrderedFixtureInterface
;
7 use Doctrine\Common\Persistence\ObjectManager
;
8 use Symfony\Component\DependencyInjection\ContainerAwareInterface
;
9 use Symfony\Component\DependencyInjection\ContainerInterface
;
10 use Wallabag\CoreBundle\Entity\SiteCredential
;
12 class LoadSiteCredentialData
extends AbstractFixture
implements OrderedFixtureInterface
, ContainerAwareInterface
15 * @var ContainerInterface
19 public function setContainer(ContainerInterface
$container = null)
21 $this->container
= $container;
27 public function load(ObjectManager
$manager)
29 $credential = new SiteCredential($this->getReference('admin-user'));
30 $credential->setHost('.super.com');
31 $credential->setUsername($this->container
->get('wallabag_core.helper.crypto_proxy')->crypt('.super'));
32 $credential->setPassword($this->container
->get('wallabag_core.helper.crypto_proxy')->crypt('bar'));
34 $manager->persist($credential);
36 $credential = new SiteCredential($this->getReference('admin-user'));
37 $credential->setHost('paywall.example.com');
38 $credential->setUsername($this->container
->get('wallabag_core.helper.crypto_proxy')->crypt('paywall.example'));
39 $credential->setPassword($this->container
->get('wallabag_core.helper.crypto_proxy')->crypt('bar'));
41 $manager->persist($credential);
49 public function getOrder()