partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

LoadUserData.php (564B)


      1 <?php
      2 
      3 namespace PartKeepr\AuthBundle\DataFixtures;
      4 
      5 use Doctrine\Common\DataFixtures\AbstractFixture;
      6 use Doctrine\Common\Persistence\ObjectManager;
      7 use PartKeepr\AuthBundle\Entity\FOSUser;
      8 
      9 class LoadUserData extends AbstractFixture
     10 {
     11     public function load(ObjectManager $manager)
     12     {
     13         $admin = new FOSUser();
     14         $admin->setUsername('admin');
     15         $admin->setPassword('admin');
     16         $admin->setEmail('foo@bar.com');
     17 
     18         $manager->persist($admin);
     19         $manager->flush();
     20 
     21         $this->addReference('user.admin', $admin);
     22     }
     23 }