Exemple #1
0
 public function load(ObjectManager $manager)
 {
     $admin = new User();
     $admin->setCreatedAt(new \DateTime());
     $admin->setUpdatedAt(new \DateTime());
     $admin->setUsername('admin');
     $admin->setUsernameCanonical('admin');
     $admin->setEmail('*****@*****.**');
     $admin->setEmailCanonical('*****@*****.**');
     $admin->setEnabled(1);
     $admin->setPlainPassword('admin');
     $admin->setSuperAdmin(true);
     //$admin->addRole(static::ROLE_SUPER_ADMIN);
     $manager->persist($admin);
     $manager->flush();
     $this->addReference('admin', $admin);
 }
Exemple #2
0
 private function onCreateNewUser($nameArray)
 {
     $user = new User();
     $user->setCreatedAt(new \DateTime());
     $user->setUsername($nameArray['nickname']);
     $user->setFacebookName($nameArray['realname']);
     $user->setEmail($nameArray['email']);
     $user->setPlainPassword($nameArray['email']);
     $user->setFacebookData($nameArray['avatar']);
     $user->setFacebookUid($nameArray['facebook_id']);
     $em = $this->doctrine->getManager();
     $em->persist($user);
     return $em->flush();
 }
 /**
  * {@inheritDoc}
  */
 public function setCreatedAt(\DateTime $createdAt = NULL)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setCreatedAt', array($createdAt));
     return parent::setCreatedAt($createdAt);
 }