public function removeUsersWithRole(Site $site, $userIdList, $role = null)
    {
        $q = $this
            ->db
            ->delete('ucms_site_access')
            ->condition('site_id', $site->id)
            ->condition('uid', $userIdList)
        ;

        if ($role) {
            $q->condition('role', $role);
        }

        $q->execute();

        $this->resetCache();
    }
public function removeUsersWithRole(Site $site, $userIdList, $role = null)
    {
        $q = $this
            ->db
            ->delete('ucms_site_access')
            ->condition('site_id', $site->id)
            ->condition('uid', $userIdList)
        ;

        if ($role) {
            $q->condition('role', $role);
        }

        $q->execute();

        $this->resetCache();
    }
public function removeUsersWithRole ( Site $ site , $ userIdList , $ role = null ) { $ q = $ this -> db -> delete ( 'ucms_site_access' ) -> condition ( 'site_id' , $ site -> id ) -> condition ( 'uid' , $ userIdList ) ; if ( $ role ) { $ q -> condition ( 'role' , $ role ) ; } $ q -> execute ( ) ; $ this -> resetCache ( ) ; }
Remove users with role

If any of the users is webmaster, this role will be kept

@param Site $site
@param int|int[] $userIdList
@param int $role
Access::ROLE_* constant
Remove users with role