src/Security/Member.php
public function memberNotInGroups($groupList, $memberGroups = null)
    {
        if (!$memberGroups) {
            $memberGroups = $this->Groups();
        }

        foreach ($memberGroups as $group) {
            if (in_array($group->Code, $groupList)) {
                $index = array_search($group->Code, $groupList);
                unset($groupList[$index]);
            }
        }

        return $groupList;
    }
public function memberNotInGroups($groupList, $memberGroups = null)
    {
        if (!$memberGroups) {
            $memberGroups = $this->Groups();
        }

        foreach ($memberGroups as $group) {
            if (in_array($group->Code, $groupList)) {
                $index = array_search($group->Code, $groupList);
                unset($groupList[$index]);
            }
        }

        return $groupList;
    }
public function memberNotInGroups ( $ groupList , $ memberGroups = null ) { if ( ! $ memberGroups ) { $ memberGroups = $ this -> Groups ( ) ; } foreach ( $ memberGroups as $ group ) { if ( in_array ( $ group -> Code , $ groupList ) ) { $ index = array_search ( $ group -> Code , $ groupList ) ; unset ( $ groupList [ $ index ] ) ; } } return $ groupList ; }
Get the groups in which the member is NOT in

When passed an array of groups, and a component set of groups, this
function will return the array of groups the member is NOT in.

@param array $groupList An array of group code names.
@param array $memberGroups A component set of groups (if set to NULL,
$this->groups() will be used)
@return array Groups in which the member is NOT in.
Get the groups in which the member is NOT in