src/ORM/ArrayList.php
public function exclude()
    {
        $removeUs = $this->normaliseFilterArgs(...func_get_args());

        $hitsRequiredToRemove = count($removeUs);
        $matches = [];
        foreach ($removeUs as $column => $excludeValue) {
            foreach ($this->items as $key => $item) {
                if (!is_array($excludeValue) && $this->extractValue($item, $column) == $excludeValue) {
                    $matches[$key] = isset($matches[$key]) ? $matches[$key] + 1 : 1;
                } elseif (is_array($excludeValue) && in_array($this->extractValue($item, $column), $excludeValue)) {
                    $matches[$key] = isset($matches[$key]) ? $matches[$key] + 1 : 1;
                }
            }
        }

        $keysToRemove = array_keys($matches, $hitsRequiredToRemove);

        $itemsToKeep = [];
        foreach ($this->items as $key => $value) {
            if (!in_array($key, $keysToRemove)) {
                $itemsToKeep[] = $value;
            }
        }

        $list = clone $this;
        $list->items = $itemsToKeep;
        return $list;
    }
public function exclude()
    {
        $removeUs = $this->normaliseFilterArgs(...func_get_args());

        $hitsRequiredToRemove = count($removeUs);
        $matches = [];
        foreach ($removeUs as $column => $excludeValue) {
            foreach ($this->items as $key => $item) {
                if (!is_array($excludeValue) && $this->extractValue($item, $column) == $excludeValue) {
                    $matches[$key] = isset($matches[$key]) ? $matches[$key] + 1 : 1;
                } elseif (is_array($excludeValue) && in_array($this->extractValue($item, $column), $excludeValue)) {
                    $matches[$key] = isset($matches[$key]) ? $matches[$key] + 1 : 1;
                }
            }
        }

        $keysToRemove = array_keys($matches, $hitsRequiredToRemove);

        $itemsToKeep = [];
        foreach ($this->items as $key => $value) {
            if (!in_array($key, $keysToRemove)) {
                $itemsToKeep[] = $value;
            }
        }

        $list = clone $this;
        $list->items = $itemsToKeep;
        return $list;
    }
public function exclude ( ) { $ removeUs = $ this -> normaliseFilterArgs ( ... func_get_args ( ) ) ; $ hitsRequiredToRemove = count ( $ removeUs ) ; $ matches = [ ] ; foreach ( $ removeUs as $ column => $ excludeValue ) { foreach ( $ this -> items as $ key => $ item ) { if ( ! is_array ( $ excludeValue ) && $ this -> extractValue ( $ item , $ column ) == $ excludeValue ) { $ matches [ $ key ] = isset ( $ matches [ $ key ] ) ? $ matches [ $ key ] + 1 : 1 ; } elseif ( is_array ( $ excludeValue ) && in_array ( $ this -> extractValue ( $ item , $ column ) , $ excludeValue ) ) { $ matches [ $ key ] = isset ( $ matches [ $ key ] ) ? $ matches [ $ key ] + 1 : 1 ; } } } $ keysToRemove = array_keys ( $ matches , $ hitsRequiredToRemove ) ; $ itemsToKeep = [ ] ; foreach ( $ this -> items as $ key => $ value ) { if ( ! in_array ( $ key , $ keysToRemove ) ) { $ itemsToKeep [ ] = $ value ; } } $ list = clone $ this ; $ list -> items = $ itemsToKeep ; return $ list ; }
Exclude the list to not contain items with these charactaristics

@return ArrayList
@see SS_List::exclude()
@example $list->exclude('Name', 'bob'); // exclude bob from list
@example $list->exclude('Name', array('aziz', 'bob'); // exclude aziz and bob from list
@example $list->exclude(array('Name'=>'bob, 'Age'=>21)); // exclude bob that has Age 21
@example $list->exclude(array('Name'=>'bob, 'Age'=>array(21, 43))); // exclude bob with Age 21 or 43
@example $list->exclude(array('Name'=>array('bob','phil'), 'Age'=>array(21, 43)));
// bob age 21 or 43, phil age 21 or 43 would be excluded
Exclude the list to not contain items with these charactaristics