Collects the filters according to the [[map]].

@throws InvalidConfigException
@return array key-value pairs of attributes and filters
@see map
435377
public function get()
    {
        $result = [];

        foreach ($this->map as $attribute => $key) {
            $value = $this->getByKey($key);
            $result[$attribute] = $value;
        }

        return $result;
    }
1199174
protected function _getConfigSet() : array
    {

        if (empty($_SERVER) && empty($GLOBALS['argv'])) {
            return [];
        }

        return $this->sortConfigSet(
            $this->getConfigSet(),
            $this->get(self::HIERARCHY_PLACEHOLDER_INDEX)
        );

    }
639200
public function ComponentListingItems()
    {
        $manyMany = singleton($this->ListType)->config()->many_many;
        $tagClass = isset($manyMany[$this->ComponentFilterName]) ? $manyMany[$this->ComponentFilterName] : '';
        if (!$tagClass) {
            return new ArrayList();
        }
        $result = DataList::create($tagClass);
        if ($this->ComponentFilterWhere
            && ($componentWhereFilters = $this->ComponentFilterWhere->getValue())
        ) {
            $result = $result->filter($componentWhereFilters);
        }
        return $result;
    }
506883
public function getAll($classname, $filter = null, AbstractModel $parent = null)
    {
        $filterUrl = '';
        if (!is_null($filter)) {
            if (
                isset($this->filters[$classname]) &&
                in_array($filter, $this->filters[$classname])) {

                $filterUrl = '/filter/' . $filter;
            } elseif (
                isset($this->filters[$classname]) &&
                preg_match('/^[0-9]+$/D', $filter)) {

                $filterUrl = '/filter/' . $filter;
            } else {
                $message = 'Unknown filter "' . $filter . '" for ' . $classname;
                if (isset($this->filters[$classname])) {
                    $message .= '; available filters: ' . implode(', ', $this->filters[$classname]);
                }
                throw new InvalidFilterException($message);
            }
        }

        $response = $this->request($this->buildUrl(new $classname(), $parent, $filterUrl), 'GET');
        return $this->mapper->mapFromStorage($response);
    }
1083048
public function getFilters()
    {
        $filters = [];

        $names = explode('_', $this->name);
        $base = '';
        $filters = [];
        while ($name = array_shift($names)) {
            $filter = $this->_searchInControllerDir($base, 'filter.yml');
            if ($filter) $filters[] = $filter;

            // when has rest.
            if (count($names) > 0) {
                $base = $base . DS . ucfirst($name);

            // when last.
            } else {
                $filter = $this->_searchInControllerDir($base, "{$name}.filter.yml");
                if ($filter) $filters[] = $filter;
            }
        }

        return $filters;
    }
119316
protected function getCustomFilters()
    {
        $filters = (array) $this->getOption('custom_filters');

        return array_filter(
            $filters,
            function ($name) {
                return is_string($name);
            },
            ARRAY_FILTER_USE_KEY
        );
    }
625088
protected function getSelectColumns() {
		//obtain attributes from config
		if ($this->hasOption('query.attrs')) {
			$columns = [];
			
			foreach ($this->getOption('query.attrs') as $attr) {
				if ($attr instanceof Attr)
					$name = $attr->getName();				
				elseif (is_string($attr))
					$name = $attr;
				else
					throw new \InvalidArgumentException("Method 'attrs' expects a list of strings or instances of \eMapper\Query\Attr");
				
				if (!$this->entityProfile->hasProperty($name))
					throw new \InvalidArgumentException(sprintf("Attribute '%s' not found in class '%s'", $name, $this->entityProfile->getReflectionClass()->getName()));
				
				$column = $this->entityProfile->getProperty($name)->getColumn();
				if (!array_key_exists($column, $columns))
					$columns[$column] = new Column($column);
			}
			
			return $columns;
		}
	
		return $this->selectColumns;
	}
188101
public function getArray()
    {
        $parsed = @parse_ini_file($this->context, true);

        if (! $parsed) {
            throw new InvalidFileException('Unable to parse invalid INI file at ' . $this->context);
        }

        return $parsed;
    }
538481
public function getMappedAttributes()
    {
        $mappedArrayForApiRequest = [];
        $requestAttributes = $this->request->getData();
        foreach ($requestAttributes as $key => $value) {
            if (array_key_exists($key, $this->mappingRequestToOtherRequestAttributes)) {
                $mappedArrayForApiRequest[$this->mappingRequestToOtherRequestAttributes[$key]] = $value;
            }
        }

        return $mappedArrayForApiRequest;
    }
1370230
public static function getIndexSchema()
    {
        $schema = static::getDb()->getIndexSchema(static::indexName());
        if ($schema !== null) {
            return $schema;
        } else {
            throw new InvalidConfigException("The index does not exist: " . static::indexName());
        }
    }
834212
public function getMappedSecondAttributes()
    {
        $attributes = [];

        /* Only the first array in data will be examined, and map its attributes to db attributes,
           the attributes that are not present, will not be included
        */
        if (is_array($this->data[0])) {
            foreach ($this->data[0] as $attribute => $attributeValue) {
                if (array_key_exists($attribute, $this->mappingFirstEntityToSecondEntityAttributes)) {
                    $attributes[$this->mappingFirstEntityToSecondEntityAttributes[$attribute]] = $attributeValue;
                }
            }
        }

        return $attributes;
    }
6998
public function getAllKeys()
    {

        // initialize the array with keys of all attributes
        $keys = array();

        // prepare the pattern to filter the attributes
        $pattern = sprintf('%s-*', $this->getSerial());

        // prepare the array with the attribute keys
        foreach (array_keys((array) $this) as $key) {
            if (fnmatch($pattern, $key)) {
                $keys[] = $this->unmaskKey($key);
            }
        }

        // return the attribute keys
        return $keys;
    }
529411
private function extractFilters(array $params)
    {
        if (false === $this->issetNotEmpty(self::PARAM_FILTERING, $params)) {
            return $this;
        }
        $filters = $params[self::PARAM_FILTERING];
        if (!is_array($filters)) {
            throw RestException::invalidQueryParam(self::PARAM_FILTERING, 'The filter parameter must be an array keyed by filter name and value.');
        }
        foreach ($filters as $key => $value) {
            $this->filters[$key] = $value;
        }
        return $this;
    }
595241
protected function getRawIncludeMap(): array
    {
        $map = [];

        foreach ($this->includes as $includeKey => $definition) {
            if (\is_int($includeKey)) {
                $includeKey = $definition;
                $definition = null;
            }

            $settings = [];
            if (!empty($definition)) {
                $parts = preg_split('/\s*\|\s*/', $definition);
                foreach ($parts as $part) {
                    if (!preg_match('/^([^:]+)(:(.+))?$/', $part, $match)) {
                        throw new ParseDefinitionException("Unable to parse field definition for '{$includeKey}''");
                    }
                    // If only list() was viable ...
                    $directive = $match[1];
                    $val = $match[3] ?? null;
                    switch ($directive) {
                        case 'default':
                            $settings['default'] = true;
                            break;
                        case 'relation':
                            $settings['relation'] = !empty($val) ?
                                preg_split('/s*,\s*/', $val) : [$includeKey];
                            break;
                        case 'method':
                            if (!empty($val)) {
                                $settings['method'] = $val;
                            }
                            break;
                        case 'item':
                            $settings['resource_type'] = 'item';
                            break;
                        case 'collection':
                            $settings['resource_type'] = 'collection';
                            break;
                        default:
                            throw new ParseDefinitionException("Invalid key '{$directive}' for {$includeKey}");
                    }
                }
            }

            if (!isset($settings['relation'])) {
                $settings['relation'] = [];
            }
            if (!isset($settings['method'])) {
                $settings['method'] = 'include'.StrHelper::studlyCase($includeKey);
            }
            if (!isset($settings['default'])) {
                $settings['default'] = false;
            }
            if (!isset($settings['resource_type'])) {
                $settings['resource_type'] = null;
            }

            $map[$includeKey] = $settings;
        }

        return $map;
    }
1206272
public function getFilters()
    {
        // @todo build commong database filters for node datasource into some
        //   trait or abstract implemetnation to avoid duplicates
        return [
            (new Filter('status', $this->t("Published")))
                ->setChoicesMap([
                    1 => $this->t("Yes"),
                    0 => $this->t("No"),
                ]),
            (new Filter('promote', $this->t("Promoted to front page")))
                ->setChoicesMap([
                    1 => $this->t("Yes"),
                    0 => $this->t("No"),
                ]),
            (new Filter('sticky', $this->t("Sticky")))
                ->setChoicesMap([
                    1 => $this->t("Yes"),
                    0 => $this->t("No"),
                ]),
            (new Filter('type', $this->t("Type")))
                ->setChoicesMap(node_type_get_names()),
            (new Filter('history_user_id', $this->t("User (history)"))),
                /* ->setChoicesMap(node_type_get_names()), @todo use callback */
            (new Filter('revision_user_id', $this->t("User (node revision)"))),
                /* ->setChoicesMap(node_type_get_names()), @todo use callback */
            (new Filter('user_id', $this->t("User (node owner)"))),
                /* ->setChoicesMap(node_type_get_names()), @todo use callback */
        ];
    }
903854
public function filteringScenarios()
    {
        $scenarios = [ActiveRecord::SCENARIO_DEFAULT => []];
        foreach ($this->getFilterValidators() as $validator) {
            foreach ($validator->on as $scenario) {
                $scenarios[$scenario] = [];
            }
            foreach ($validator->except as $scenario) {
                $scenarios[$scenario] = [];
            }
        }
        $names = array_keys($scenarios);

        foreach ($this->getFilterValidators() as $validator) {
            if (empty($validator->on) && empty($validator->except)) {
                foreach ($names as $name) {
                    foreach ($validator->attributes as $attribute) {
                        $scenarios[$name][$attribute] = true;
                    }
                }
            } elseif (empty($validator->on)) {
                foreach ($names as $name) {
                    if (!in_array($name, $validator->except, true)) {
                        foreach ($validator->attributes as $attribute) {
                            $scenarios[$name][$attribute] = true;
                        }
                    }
                }
            } else {
                foreach ($validator->on as $name) {
                    foreach ($validator->attributes as $attribute) {
                        $scenarios[$name][$attribute] = true;
                    }
                }
            }
        }

        foreach ($scenarios as $scenario => $attributes) {
            if (!empty($attributes)) {
                $scenarios[$scenario] = array_keys($attributes);
            }
        }

        foreach ([ActiveRecord::SCENARIO_CREATE, ActiveRecord::SCENARIO_UPDATE] as $scenario) {
            if (!isset($scenarios[$scenario])) {
                $scenarios[$scenario] = $scenarios[ActiveRecord::SCENARIO_DEFAULT];
            }
        }
        return $scenarios;
    }
33076
private function getAttributes($configArray)
    {
        $attributes = [];
        foreach ($configArray as $key => $value) {
            if (is_string($key)) {
                $attributes[] = $key;
            } else {
                if (is_string($value)) {
                    $attributes[] = $value;
                } else {
                    throw new InvalidConfigException('Wrong configured attribute');
                }
            }
        }
        return $attributes;
    }