Ejemplo n.º 1
0
 public function load(ObjectManager $manager)
 {
     $listNames = array('Alexandre', 'Marine', 'Anna');
     foreach ($listNames as $name) {
         $user = new User();
         $user->setUsername($name);
         $user->setPassword($name);
         $user->setEmail("{$name}@seum.do");
         $user->setRoles(array('ROLE_AUTEUR'));
         $manager->persist($user);
     }
     $manager->flush();
 }
 /**
  * {@inheritDoc}
  */
 public function setRoles(array $roles)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setRoles', [$roles]);
     return parent::setRoles($roles);
 }