@param string         $namespace
@param array          $filter
@param array          $options
@param ReadPreference $readPreference

@return array
192360
protected function _fetchAll($namespace, $filter, $options, $readPreference)
    {
        $cursor = $this->_getManager()->executeQuery($namespace, new MongodbQuery($filter, $options), $readPreference);
        $cursor->setTypeMap(['root' => 'array']);
        return $cursor->toArray();
    }
112723
public function searchFilter($searchFilters, $options = [])
    {
        $_options = [];

        $options = array_merge($_options, $options);

        return ($searchFilters ? $this->Search->filterForm($searchFilters) : null);
    }
158542
public function html(array $options = [], array $namespaces = [])
    {
        $this->addNamespace('og', 'http://ogp.me/ns#');
        $this->addNamespace('fb', 'http://ogp.me/ns/fb#');

        if ($namespaces) {
            foreach ($namespaces as $ns => $url) {
                $this->addNamespace($ns, $url);
            }
        }

        $this->setType($this->config('type'));
        $this->setUri($this->request->here);
        $this->setTitle($this->_View->fetch('title'));

        if ($appId = $this->config('app_id')) {
            $this->setAppId($appId);
        }

        return $this->Html->tag('html', null, $this->config('namespaces') + $options);
    }
1359933
public function buildFilters($options) {
        if (empty($options['filters']) || !is_array($options['filters'])) return [];
        return array_filter(array_map(function($filter) {
            if (empty($this->config['filters'][$filter])) return;
            return new $this->config['filters'][$filter];
        }, $options['filters']));
    }
649379
public function compileCheckboxOptions($filter, $options)
    {
        $allOptionsOfCurrentFilter = $filter['options'];

        // alphabetical sorting of filter options
        if ($filter['alphabeticalsorting'] == 1) {
            $this->sortArrayByColumn($allOptionsOfCurrentFilter, 'title');
        }

        // loop through options
        $checkboxOptions = array();
        if (is_array($allOptionsOfCurrentFilter)) {
            foreach ($allOptionsOfCurrentFilter as $key => $data) {
                $data['key'] = $key;

                // check if current option (of searchresults) is in array of all possible options
                $isOptionInOptionArray = false;
                if (is_array($options)) {
                    foreach ($options as $optionInResultList) {
                        if ($optionInResultList['value'] == $data['tag']) {
                            $isOptionInOptionArray = true;
                            $data['results'] = $optionInResultList['results'];
                            break;
                        }
                    }
                }

                // if option is in optionArray, we have to mark the checkboxes
                if ($isOptionInOptionArray) {
                    // if user has selected a checkbox it must be selected on the resultpage, too.
                    // options which have been preselected in the backend are
                    // already in $this->piVars['filter'][$filter['uid]]
                    if ($this->piVars['filter'][$filter['uid']][$key]) {
                        $data['selected'] = 1;
                    }

                    // mark all checkboxes if that config options is set and no search string was given and there
                    // are no preselected filters given for that filter
                    if ($this->isEmptySearch
                        && $filter['markAllCheckboxes']
                        && empty($this->preselectedFilter[$filter['uid']])
                    ) {
                        $data['selected'] = 1;
                    }
                } else { // if an option was not found in the search results
                    $data['disabled'] = 1;
                }

                $data['id'] = 'filter_' . $filter['uid'] . '_' . $key;
                $checkboxOptions[] = $data;
            }
        }

        // modify filter options by hook
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilterOptions'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilterOptions'] as $_classRef) {
                $_procObj = &GeneralUtility::makeInstance($_classRef);
                $_procObj->modifyFilterOptions($filter, $checkboxOptions, $this);
            }
        }

        return $checkboxOptions;
    }
1161770
private function getParameters($namespace)
    {
        $parameters = [];

        /** @var Parameter $parameter */
        foreach ($this->parameterRepository->findBy(['namespace' => $namespace]) as $parameter) {
            $parameters[$parameter->getName()] = $parameter->getValue();
        }

        return $parameters;
    }
70849
public static function getOptionSets($filter = array())
    {
        $filter = Filter::create($filter);
        return self::getCollection('/optionsets' . $filter->toQuery(), 'OptionSet');
    }
577630
public function searchSpecifications(array $filters = [], array $options = [])
    {
        $data = [
            'body' => ['query' => $filters]
        ];

        $response = $this->kuzzle->query(
            $this->kuzzle->buildQueryArgs('collection', 'searchSpecifications'),
            $data,
            $options
        );

        return $response['result'];
    }
736211
public function read($query, array $options = []) {
		$query = !is_object($query) ? new Query() : $query;
		$query->method() ?: $query->method("get");
		$query->path() ?: $query->path("/{:source}");

		$params = [$query, $options];

		return Filters::run($this, __FUNCTION__, $params, function($params) {
			list($query, $options) = $params;
			return $this->send($query, $options);
		});
	}
567914
static function GetData($name, $filter = FILTER_DEFAULT, $options = null)
    {
        return filter_input(INPUT_GET, $name, $filter, $options);
    }
38416
private function readFiltersAndFlags(array $options, $filter = DEFAULT_FILTER, $flags = [])
    {

        //Merge the flags
        $_flags = (isset($options['flags']) && is_array($options['flags']))
            ? array_merge($options['flags'], [])
            : $flags;

        unset($options['filters']);
        // unset($options['flags']);


        //The PHP default santize (filter) uses a defined option definition format
        // array("options"=>array(), "filters"=>array(), "flags"=>array())
        $parameters = array_merge_recursive($options, ["flags" => $_flags]);

        return [$filter, $_flags, $parameters];

    }
28881
private function createFilter($filter, $options = null)
    {
        $params = [];
        $data = $this->classmap[$filter];
        if (isset($options)) {
            if (!isset($data['options'])) {
                throw new InvalidConfigException('Filter "' . $filter . '" has no options.');
            }
            foreach ($options as $option => $value) {
                if (!isset($data['options'][$option])) {
                    throw new InvalidConfigException('Option "' . $option . '" is not defined for filter "' . $filter . '".');
                }
                $o = array_merge(['accept' => 'item', 'call' => 'param'], $data['options'][$option]);
                $ref = $o['reference'];
                if (!isset($params[$ref])) {
                    $params[$ref] = [];
                }
                if (isset($o['method']) && $o['call'] == 'param') {
                    $o['call'] = 'method';
                }
                if (!isset($o['method']) && $o['call'] == 'method') {
                    $o['method'] = $option;
                }
                if ($o['accept'] == 'items') {
                    if (!is_array($value)) {
                        throw new InvalidConfigException('Expects option "' . $option . '" to be array, ' .
                            gettype($value) . ' given in filter "' . $filter . '".');
                    }
                }
                if (isset($o['filter'])) {
                    if ($o['accept'] == 'items') {
                        foreach ($value as $k => &$v) {
                            $v = $o['filter']($v);
                        }
                    }
                    else {
                        $value = $o['filter']($value);
                    }
                }
                switch ($o['call']) {
                    case 'compact':
                        $key = isset($o['method']) ? 'method' : 'param';
                        if (!isset($params[$ref][$key])) {
                            $params[$ref][$key] = [];
                        }
                        if (isset($o['method'])) {
                            if (!isset($params[$ref][$key][$o['method']])) {
                                $params[$ref][$key][$o['method']] = [$option => $value];
                            } else {
                                array_push($params[$ref][$key][$o['method']], [$option => $value]);
                            }
                        } else {
                            $params[$ref][$key] = array_merge_recursive($params[$ref][$key], [$option => $value]);
                        }
                        break;
                    case 'method':
                        if (!isset($params[$ref]['method'])) {
                            $params[$ref]['method'] = [];
                        }
                        $params[$ref]['method'][] = [$o['method'], $value];
                        break;
                    case 'property':
                        if (!isset($params[$ref]['property'])) {
                            $params[$ref]['property'] = [];
                        }
                        $params[$ref]['property'][isset($o['property']) ? $o['property'] : $option] = $value;
                        break;
                    case 'param':
                        $params[$ref]['param'] = $value;
                        break;
                }
            }
        }
        foreach (['parser', 'renderer', 'filter'] as $type) {
            if (isset($data[$type])) {
                $args = [];
                if ($type == 'filter') {
                    array_push($args, $data['parser']);
                    if (isset($data['renderer'])) {
                        array_push($args, $data['renderer']);
                    }
                }
                if (isset($params[$type]['param'])) {
                    if (isset($data[$type.'_params_offset'])) {
                        $args += $data[$type.'_params_offset'];
                    }
                    array_push($args, $params[$type]['param']);
                }
                $object = (new ReflectionClass($data[$type]))->newInstanceArgs($args);
                if (!empty($params[$type]['method'])) {
                    foreach ($params[$type]['method'] as $name => $opt) {
                        if (is_numeric($name)) {
                            $object->$opt[0]($opt[1]);
                        } else {
                            $object->$name($opt);
                        }
                    }
                }
                if (!empty($params[$type]['property'])) {
                    foreach ($params[$type]['property'] as $property => $value) {
                        $object->$property = $value;
                    }
                }
                $data[$type] = $object;
            }
        }
        if (isset($params['self']) && !empty($params['self']['method'])) {
            foreach ($params['self']['method'] as $name => $opt) {
                if (is_numeric($name)) {
                    $this->$opt[0]($data, $opt[1]);
                } else {
                    $this->$name($data, $opt);
                }
            }
        }
        return $data['filter'];
    }
291588
protected function parseRoutes(RouteCollection $routes, $filter, $namespace)
    {
        $this->guardAgainstZeroRoutes($routes);

        $results = [];

        foreach ($routes as $route) {
            $results[] = $this->getRouteInformation($route, $filter, $namespace);
        }

        return array_values(array_filter($results));
    }
1089373
protected function scanPhpFile(string $dir, string $namespace)
    {
        if (!is_dir($dir)) {
            return [];
        }

        $iterator = new \RecursiveDirectoryIterator($dir);
        $files    = new \RecursiveIteratorIterator($iterator);

        $phpFiles = [];
        foreach ($files as $file) {
            $fileType = pathinfo($file, PATHINFO_EXTENSION);
            if ($fileType != 'php') {
                continue;
            }

            $replaces = ['', '\\', '', ''];
            $searches = [$dir, '/', '.php', '.PHP'];

            $file       = str_replace($searches, $replaces, $file);
            $phpFiles[] = $namespace . $file;
        }

        return $phpFiles;
    }
70932
public function handle(FilterOptionInterface $filter, array $options)
    {
        if (count($options) === 0) {
            return $filter;
        }

        $validOptions = $filter->getValidOptions();

        $this->validateFilterOptions($options, $validOptions);
        $this->setFilterOptions($filter, $options, $validOptions);

        return $filter;
    }
683653
private function createNamespaceIterator(array $namespaces): Iterator
    {
        $files = new AppendIterator();

        foreach ($namespaces as $classmap) {
            $files->append(
                $this->createClassmapIterator($classmap)
            );
        }

        return $files;
    }
975236
public static nsxmlnamespace[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{
		nsxmlnamespace obj = new nsxmlnamespace();
		options option = new options();
		option.set_filter(filter);
		nsxmlnamespace[] response = (nsxmlnamespace[]) obj.getfiltered(service, option);
		return response;
	}