Filter Callback.
@access		public
@return		bool
547540
public function accept()
	{
		$this->numberScanned++;
		if( !parent::accept() )
			return FALSE;
		$this->numberFound++;
		if( !$this->contentPattern )
			return TRUE;
		$filePath	= $this->current()->getPathname();
		$realPath	= realpath( $this->current()->getPathname() );
		if( $realPath )
			$filePath	= $realPath;
		$content	= FS_File_Reader::load( $filePath );
		$found		= preg_match( $this->contentPattern, $content );
		return $found;
	}
1146019
protected function _isFilterRequest()
    {
        return (
            $this->controller !== null  &&
            $this->request !== null &&
            $this->action !== null &&
            $this->_filterEnabled
        );
    }
298132
public function filter_function($args)
    {
        return function ($item) use ($args) {
            $columns = $args['columns'];
            $search = $args['search']['value'];
            if (!empty($search)) {
                if ($item instanceof Model) {
                    foreach ($columns as $key => $value) {
                        if ($value['searchable']) {
                            $columnValue = $this->getFiledValue($item, $key);
                            if (strpos($columnValue, $search) !== false) {
                                return true;
                            }
                        }
                    }
                }
                return false;
            }
            return true;
        };
    }
1295983
public function reject($callback = true)
    {
        $useAsCallable = $this->useAsCallable($callback);

        return $this->filter(function ($value, $key) use ($callback, $useAsCallable) {
            return $useAsCallable
                ? ! $callback($value, $key)
                : $value != $callback;
        });
    }
1318825
public function filter(\Closure $callback)
    {
        $collection = new static();

        foreach ($this as $element) {
            if ($callback($element)) {
                $collection->attach($element);
            }
        }

        return $collection;
    }
1027706
private function queryFilterRequest()
    {
        if (!$safeFilter = Request::get('filter')) {
            return false;
        }

        if (!isset($this->safeFilters()[$safeFilter])) {
            return false;
        }

        return $this->query = $this->filters()[$this->safeFilters()[$safeFilter]];
    }
947249
public function filtersOnID()
    {
        $regexp = '/^(.*\.)?("|`)?ID("|`)?\s?(=|IN)/';

        foreach ($this->getWhereParameterised($parameters) as $predicate) {
            if (preg_match($regexp, $predicate)) {
                return true;
            }
        }

        return false;
    }
817474
protected function checkFilters()
    {
        $current = $this->prepareForReturn($this->current);

        foreach ($this->filters as $tuple) {
            $result = call_user_func(
                $tuple[0],
                $current->copy(),
                $this->key,
                $this
            );

            if ($result === static::END_ITERATION) {
                return static::END_ITERATION;
            }

            if (!$result) {
                return false;
            }
        }

        return true;
    }
1338204
public function filterByExtension()
	{
		// The call back that filters files through the finder
		$filter = function (\SplFileInfo $file) {
			
			return in_array($file->getExtension(), $this->extensions);
		};

		$this->filter($filter);
	}
1313279
public function filter(callable $callback = null)
    {
        foreach ($this->items as $key => $value) {
            if (
                (!$callback && !(bool)$value) ||
                ($callback && !$callback($value, $key))
            ) {
                unset($this->items[$key]);
            }
        }

        return $this;
    }
995139
def filter_callbacks(cls, client, event_data):
        """"""

        for event in cls.filter_events(client, event_data):
            for cb in event.callbacks:
                yield cb
1343944
public function beforeFilter() {
        if(!isset($this->_beforeFilters[$this->_action])) {
            return false;
        }

        foreach($this->_beforeFilters[$this->_action] as $method) {
            call_user_func($method);
        }
    }
217215
public function containsCallback(callable $callback)
	{
		// Normalize the callback
		$pc = new ProgrammableCallback($callback);
		$callback = $pc->getCallback();
		foreach ($this->items as $filter)
		{
			if ($callback === $filter->getCallback())
			{
				return true;
			}
		}

		return false;
	}
649474
public function delete()
    {
        if ($this->callbackUnset instanceof \Closure) {
            return call_user_func_array($this->callbackUnset, [$this->getId()]);
        }

        return false;
    }
1117642
public function removeFilter( $filter, $callback )
    {
        $i = 0;

        foreach( $this->filters as $key => $value )
        {
            if ( $filter === $key )
            {
                foreach( $value as $f => $call )
                {
                    if ( get_class( $callback[ 0 ] ) === get_class( $call[ 'callback' ][ 0 ] ) )
                    {
                        if ( $callback[ 1 ] === $call[ 'callback' ][ 1 ] )
                        {
                            unset( $this->filters[ $key ][ $i ] );

                            if ( $this->debug )
                            {
                                echo PHP_EOL . '-FILTER: ' . $filter . ' -> '
                                        . $this->_serializeCallback( $callback )
                                        . ' + Priority: ' . $call[ 'priority' ]
                                        . PHP_EOL;
                            }

                            return TRUE;
                        }
                    }
                }
            }

            $i++;
        }

        return FALSE;
    }
691376
public function isFiltered()
    {
        if (!$this->adapter instanceof FilteredAdapter) {
            return false;
        }

        $filteredAdapter = $this->adapter;
        $filteredAdapter->isFiltered();
    }
973222
public function filterPosters()
    {
        return $this->filter(
            function ($key, $value) {
                if ($value instanceof ImageFilter && $value instanceof Image\PosterImage) {
                    return true;
                }
            }
        );
    }