code/object/set.php
public function filter(/*Callable*/ $filter)
    {
        $result = clone $this;
        foreach ($this as $object)
        {
            if (call_user_func($filter, $object) === false) {
                $result->remove($object);
            }
        }

        return $result;
    }
public function filter(/*Callable*/ $filter)
    {
        $result = clone $this;
        foreach ($this as $object)
        {
            if (call_user_func($filter, $object) === false) {
                $result->remove($object);
            }
        }

        return $result;
    }
public function filter ( /*Callable*/ $ filter ) { $ result = clone $ this ; foreach ( $ this as $ object ) { if ( call_user_func ( $ filter , $ object ) === false ) { $ result -> remove ( $ object ) ; } } return $ result ; }
Filter the set using a callback

If the callback returns FALSE the object will not be included in the resulting object set.

@param   Callable $filter A callback that will handle the filtering
@return  ObjectSet Returns an object subset
Filter the set using a callback