Beispiel #1
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $Admin = new Role();
     $Admin->setEtiqueta('ROLE_ADMIN');
     $manager->persist($Admin);
     $manager->flush();
 }
 public function load(ObjectManager $manager)
 {
     $roles = array('ROLE_ADMIN', 'ROLE_USER');
     foreach ($roles as $role) {
         $newRole = new Role();
         $newRole->setEtiqueta($role);
         $manager->persist($newRole);
     }
     $manager->flush();
 }
Beispiel #3
0
 public function load(ObjectManager $manager)
 {
     $array = ['ROLE_SUPER_ADMIN', 'ROLE_ADMIN', 'ROLE_USER', 'ROLE_EDITOR', 'ROLE_JEFE_DE_COMISION'];
     foreach ($array as $element) {
         $role = new Role();
         $role->setEtiqueta($element);
         $manager->persist($role);
     }
     $manager->flush();
 }
 /**
  * Creates a form to delete a Role entity.
  *
  * @param Role $role The Role entity
  *
  * @return \Symfony\Component\Form\Form The form
  */
 private function createDeleteForm(Role $role)
 {
     return $this->createFormBuilder()->setAction($this->generateUrl('role_delete', array('id' => $role->getId())))->setMethod('DELETE')->getForm();
 }