src/Component/AuthManager.php
public function addRole(Role $role)
    {
        try {
            $this->saveEntity($role);
        } catch (UniqueConstraintViolationException $e) {
            throw new NotUniqueException('Role with name ' . $role->getName() . ' already created');
        }
    }
public function addRole(Role $role)
    {
        try {
            $this->saveEntity($role);
        } catch (UniqueConstraintViolationException $e) {
            throw new NotUniqueException('Role with name ' . $role->getName() . ' already created');
        }
    }
public function addRole ( Role $ role ) { try { $ this -> saveEntity ( $ role ) ; } catch ( UniqueConstraintViolationException $ e ) { throw new NotUniqueException ( 'Role with name ' . $ role -> getName ( ) . ' already created' ) ; } }
Save role in database
@param Role $role
@throws NotUniqueException
@throws DatabaseException
Save role in database