/** * Load fixtures. * * @param \Doctrine\Common\Persistence\ObjectManager $manager */ public function load(ObjectManager $manager) { $manager->clear(); $discriminator = $this->container->get('pugx_user.manager.user_discriminator'); $discriminator->setClass('Truckee\\MatchBundle\\Entity\\Staff'); $userManager = $this->container->get('pugx_user_manager'); $staff = $userManager->createUser(); $staff->setUsername('bborko'); $staff->setEmail('*****@*****.**'); $staff->setPlainPassword('123Abcd'); $staff->setEnabled(true); $staff->setFirstName('Benny'); $staff->setLastName('Borko'); $staff->addRole('ROLE_STAFF'); $org = new Organization(); $org->setOrgName('Turkeys R Us'); $org->setAddress('PO Box 234'); $org->setCity('Truckee'); $org->setState('CA'); $org->setZip('96160'); $org->setWebsite('www.turkeys.org'); $org->setEmail('*****@*****.**'); $org->setTemp(false); $org->setAddDate(new \DateTime()); $foc1 = $manager->getRepository('TruckeeMatchBundle:Focus')->findOneByFocus('Animal Welfare'); $org->addFocus($foc1); $manager->persist($org); $staff->setOrganization($org); $manager->flush(); $userManager->updateUser($staff, true); }
/** * Load fixtures. * * @param \Doctrine\Common\Persistence\ObjectManager $manager */ public function load(ObjectManager $manager) { $manager->clear(); $discriminator = $this->container->get('pugx_user.manager.user_discriminator'); $discriminator->setClass('Truckee\\MatchBundle\\Entity\\Staff'); $userManager = $this->container->get('pugx_user_manager'); $staff = $userManager->createUser(); $staff->setUsername('jmelanzane'); $staff->setEmail('*****@*****.**'); $staff->setPlainPassword('123Abcd'); $staff->setEnabled(true); $staff->setFirstName('Joe'); $staff->setLastName('Melanzane'); $staff->addRole('ROLE_STAFF'); $org = new Organization(); $org->setOrgName('Glenshire Marmite Fund'); $org->setAddress('PO Box 999'); $org->setCity('Truckee'); $org->setState('CA'); $org->setZip('96160'); $org->setWebsite('www.melanzanemarmots.org'); $org->setEmail('*****@*****.**'); $org->setTemp(true); $foc1 = $manager->getRepository('TruckeeMatchBundle:Focus')->findOneByFocus('Seniors'); $org->addFocus($foc1); $manager->persist($org); $staff->setOrganization($org); $manager->flush(); $userManager->updateUser($staff, true); }