Commit 4d005456 authored by dj3c1t's avatar dj3c1t

data fixture pour roles

parent 25be45d9
<?php
namespace Dj3c1t\AppBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Dj3c1t\AppBundle\Entity\Role;
class LoadAppBaseData implements FixtureInterface {
public function load(ObjectManager $manager) {
$adminRole = new Role();
$adminRole->setName('admin');
$adminRole->setRole('ROLE_ADMIN');
$manager->persist($adminRole);
$adminRole = new Role();
$adminRole->setName('user');
$adminRole->setRole('ROLE_USER');
$manager->persist($adminRole);
$manager->flush();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment