src/ORM/DataList.php
public function filter()
    {
        // Validate and process arguments
        $arguments = func_get_args();
        switch (sizeof($arguments)) {
            case 1:
                $filters = $arguments[0];

                break;
            case 2:
                $filters = [$arguments[0] => $arguments[1]];

                break;
            default:
                throw new InvalidArgumentException('Incorrect number of arguments passed to filter()');
        }

        return $this->addFilter($filters);
    }
public function filter()
    {
        // Validate and process arguments
        $arguments = func_get_args();
        switch (sizeof($arguments)) {
            case 1:
                $filters = $arguments[0];

                break;
            case 2:
                $filters = [$arguments[0] => $arguments[1]];

                break;
            default:
                throw new InvalidArgumentException('Incorrect number of arguments passed to filter()');
        }

        return $this->addFilter($filters);
    }
public function filter ( ) { // Validate and process arguments $ arguments = func_get_args ( ) ; switch ( sizeof ( $ arguments ) ) { case 1 : $ filters = $ arguments [ 0 ] ; break ; case 2 : $ filters = [ $ arguments [ 0 ] => $ arguments [ 1 ] ] ; break ; default : throw new InvalidArgumentException ( 'Incorrect number of arguments passed to filter()' ) ; } return $ this -> addFilter ( $ filters ) ; }
Return a copy of this list which only includes items with these charactaristics

@see SS_List::filter()

@example $list = $list->filter('Name', 'bob'); // only bob in the list
@example $list = $list->filter('Name', array('aziz', 'bob'); // aziz and bob in list
@example $list = $list->filter(array('Name'=>'bob', 'Age'=>21)); // bob with the age 21
@example $list = $list->filter(array('Name'=>'bob', 'Age'=>array(21, 43))); // bob with the Age 21 or 43
@example $list = $list->filter(array('Name'=>array('aziz','bob'), 'Age'=>array(21, 43)));
// aziz with the age 21 or 43 and bob with the Age 21 or 43

Note: When filtering on nullable columns, null checks will be automatically added.
E.g. ->filter('Field:not', 'value) will generate '... OR "Field" IS NULL', and
->filter('Field:not', null) will generate '"Field" IS NOT NULL'

@todo extract the sql from $customQuery into a SQLGenerator class

@param string|array Escaped SQL statement. If passed as array, all keys and values will be escaped internally
@return $this
Return a copy of this list which only includes items with these charactaristics