Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function load(ObjectManager $manager)
 {
     $manager->clear();
     $focus = new Focus();
     $focus->setFocus('All');
     $focus->setEnabled(true);
     $manager->persist($focus);
     $skill = new Skill();
     $skill->setSkill('All');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $manager->flush();
     $discriminator = $this->container->get('pugx_user.manager.user_discriminator');
     $discriminator->setClass('Truckee\\MatchBundle\\Entity\\Admin');
     $userManager = $this->container->get('pugx_user_manager');
     $admin = $userManager->createUser();
     $userName = $this->container->getParameter('admin_username');
     $email = $this->container->getParameter('admin_email');
     $password = $this->container->getParameter('admin_password');
     $firstName = $this->container->getParameter('admin_first_name');
     $lastName = $this->container->getParameter('admin_last_name');
     $admin->setUsername($userName);
     $admin->setEmail($email);
     $admin->setPlainPassword($password);
     $admin->setEnabled(true);
     $admin->setFirstName($firstName);
     $admin->setLastName($lastName);
     $admin->addRole('ROLE_SUPER_ADMIN');
     $userManager->updateUser($admin, true);
 }
Exemplo n.º 2
0
 /**
  * Load fixtures.
  *
  * @param \Doctrine\Common\Persistence\ObjectManager $manager
  */
 public function load(ObjectManager $manager)
 {
     $manager->clear();
     gc_collect_cycles();
     // Could be useful if you have a lot of fixtures
     $focus = new Focus();
     $focus->setFocus('Animal Welfare');
     $focus->setEnabled(true);
     $manager->persist($focus);
     $focus = new Focus();
     $focus->setFocus('Seniors');
     $focus->setEnabled(true);
     $manager->persist($focus);
     $focus = new Focus();
     $focus->setFocus('Arts and Culture');
     $focus->setEnabled(true);
     $manager->persist($focus);
     $focus = new Focus();
     $focus->setFocus('Civic and Public Benefit');
     $focus->setEnabled(true);
     $manager->persist($focus);
     $focus = new Focus();
     $focus->setFocus('Education');
     $focus->setEnabled(true);
     $manager->persist($focus);
     $focus = new Focus();
     $focus->setFocus('Environment and Conservation');
     $focus->setEnabled(true);
     $manager->persist($focus);
     $focus = new Focus();
     $focus->setFocus('Health');
     $focus->setEnabled(true);
     $manager->persist($focus);
     $focus = new Focus();
     $focus->setFocus('Human Services');
     $focus->setEnabled(true);
     $manager->persist($focus);
     $focus = new Focus();
     $focus->setFocus('Recreation');
     $focus->setEnabled(true);
     $manager->persist($focus);
     $focus = new Focus();
     $focus->setFocus('Youth Development');
     $focus->setEnabled(true);
     $manager->persist($focus);
     $skill = new Skill();
     $skill->setSkill('Administrative Support');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $skill = new Skill();
     $skill->setSkill('Board Member');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $skill = new Skill();
     $skill->setSkill('Computers & IT');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $skill = new Skill();
     $skill->setSkill('Construction/Handy Man');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $skill = new Skill();
     $skill->setSkill('Driving');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $skill = new Skill();
     $skill->setSkill('Fundraising/Grant Writing');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $skill = new Skill();
     $skill->setSkill('Health Care');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $skill = new Skill();
     $skill->setSkill('Management');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $skill = new Skill();
     $skill->setSkill('Marketing/PR');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $skill = new Skill();
     $skill->setSkill('Customer Service');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $skill = new Skill();
     $skill->setSkill('Mentoring/Tutoring');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $skill = new Skill();
     $skill->setSkill('Web/Graphics Design');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $skill = new Skill();
     $skill->setSkill('Legal Services');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $skill = new Skill();
     $skill->setSkill('Accounting/Bookkeeping');
     $skill->setEnabled(true);
     $manager->persist($skill);
     $this->addReference('focus', $focus);
     $this->addReference('skill', $skill);
     $manager->flush();
 }