src/ORM/DataList.php
public function exclude()
    {
        $numberFuncArgs = count(func_get_args());
        $whereArguments = [];

        if ($numberFuncArgs == 1 && is_array(func_get_arg(0))) {
            $whereArguments = func_get_arg(0);
        } elseif ($numberFuncArgs == 2) {
            $whereArguments[func_get_arg(0)] = func_get_arg(1);
        } else {
            throw new InvalidArgumentException('Incorrect number of arguments passed to exclude()');
        }

        return $this->alterDataQuery(function (DataQuery $query) use ($whereArguments) {
            $subquery = $query->disjunctiveGroup();

            foreach ($whereArguments as $field => $value) {
                $filter = $this->createSearchFilter($field, $value);
                $filter->exclude($subquery);
            }
        });
    }
public function exclude()
    {
        $numberFuncArgs = count(func_get_args());
        $whereArguments = [];

        if ($numberFuncArgs == 1 && is_array(func_get_arg(0))) {
            $whereArguments = func_get_arg(0);
        } elseif ($numberFuncArgs == 2) {
            $whereArguments[func_get_arg(0)] = func_get_arg(1);
        } else {
            throw new InvalidArgumentException('Incorrect number of arguments passed to exclude()');
        }

        return $this->alterDataQuery(function (DataQuery $query) use ($whereArguments) {
            $subquery = $query->disjunctiveGroup();

            foreach ($whereArguments as $field => $value) {
                $filter = $this->createSearchFilter($field, $value);
                $filter->exclude($subquery);
            }
        });
    }
public function exclude ( ) { $ numberFuncArgs = count ( func_get_args ( ) ) ; $ whereArguments = [ ] ; if ( $ numberFuncArgs == 1 && is_array ( func_get_arg ( 0 ) ) ) { $ whereArguments = func_get_arg ( 0 ) ; } elseif ( $ numberFuncArgs == 2 ) { $ whereArguments [ func_get_arg ( 0 ) ] = func_get_arg ( 1 ) ; } else { throw new InvalidArgumentException ( 'Incorrect number of arguments passed to exclude()' ) ; } return $ this -> alterDataQuery ( function ( DataQuery $ query ) use ( $ whereArguments ) { $ subquery = $ query -> disjunctiveGroup ( ) ; foreach ( $ whereArguments as $ field => $ value ) { $ filter = $ this -> createSearchFilter ( $ field , $ value ) ; $ filter -> exclude ( $ subquery ) ; } } ) ; }
Return a copy of this list which does not contain any items that match all params

@example $list = $list->exclude('Name', 'bob'); // exclude bob from list
@example $list = $list->exclude('Name', array('aziz', 'bob'); // exclude aziz and bob from list
@example $list = $list->exclude(array('Name'=>'bob, 'Age'=>21)); // exclude bob that has Age 21
@example $list = $list->exclude(array('Name'=>'bob, 'Age'=>array(21, 43))); // exclude bob with Age 21 or 43
@example $list = $list->exclude(array('Name'=>array('bob','phil'), 'Age'=>array(21, 43)));
// bob age 21 or 43, phil age 21 or 43 would be excluded

@todo extract the sql from this method into a SQLGenerator class

@param string|array
@param string [optional]

@return $this
Return a copy of this list which does not contain any items that match all params