public function setPlatformRoles(Group $group, $roles)
    {
        foreach ($group->getPlatformRoles() as $role) {
            $group->removeRole($role);
        }

        $this->om->persist($group);
        $this->roleManager->associateRoles($group, $roles);
        $this->om->flush();
    }
public function setPlatformRoles(Group $group, $roles)
    {
        foreach ($group->getPlatformRoles() as $role) {
            $group->removeRole($role);
        }

        $this->om->persist($group);
        $this->roleManager->associateRoles($group, $roles);
        $this->om->flush();
    }
public function setPlatformRoles ( Group $ group , $ roles ) { foreach ( $ group -> getPlatformRoles ( ) as $ role ) { $ group -> removeRole ( $ role ) ; } $ this -> om -> persist ( $ group ) ; $ this -> roleManager -> associateRoles ( $ group , $ roles ) ; $ this -> om -> flush ( ) ; }
Sets an array of platform role to a group.

@param Group $group
@param array $roles
Sets an array of platform role to a group .