Input::filter

@param int  $type
@param null $offset
@param int  $filter

@return mixed|\O2System\Spl\DataStructures\SplArrayObject|string
545912
protected function filter($type, $offset = null, $filter = FILTER_DEFAULT)
    {
        if (services()->has('xssProtection')) {
            if ( ! services()->get('xssProtection')->verify()) {
                $string = parent::filter($type, $offset, $filter);

                if (is_string($string)) {
                    return Xss::clean($string);
                }
            }
        }

        return parent::filter($type, $offset, $filter);
    }
630274
public function dataTypesGet( $filter = null )
    {

        // array of string
        if( func_num_args() > 1 and \Bond\array_check( 'is_string', func_get_args() ) ) {
            $filter = func_get_args();
        }

        // filter constants
        if( is_int( $filter ) ) {

            $dataTypes = array();

            if( $filter & DataType::PRIMARY_KEYS ) {
                $dataTypes += array_filter(
                    $this->dataTypes,
                    function( $dataType ) {
                        return $dataType->isPrimaryKey();
                    }
                );
            }

            if( $filter & DataType::FORM_CHOICE_TEXT ) {
                $dataTypes += array_filter(
                    $this->dataTypes,
                    function( $dataType ) {
                        return $dataType->isFormChoiceText();
                    }
                );
            }

            if( $filter & DataType::AUTOCOMPLETE ) {
                $dataTypes += array_filter(
                    $this->dataTypes,
                    function( $dataType ) {
                        return $dataType->isAutoComplete();
                    }
                );
            }

            // todo. build a datatype from the $this->links et al
            if( $filter & DataType::LINKS ) {
            }

            return $dataTypes;

        }

        if( is_string( $filter ) ) {
            $filter = array( $filter );
        }

        if( is_array($filter) ) {

            $result = array_intersect_key( $this->dataTypes, array_flip( $filter ) );

            if ( count($result) != count($filter) ) {
                throw new \InvalidArgumentException(
                    sprintf(
                        'Unknown columns "%s" passed to %s->dataTypesGet()',
                        implode( '","', array_diff( $filter, array_keys( $result ) ) ),
                        $this->entity
                    )
                );
            }

            return $result;
        }

        if( $filter instanceof \Closure ) {
            return array_filter( $this->dataTypes, $filter );
        }

        return $this->dataTypes;
    }
952642
private static function fixFilterFieldPath(?Filter $filter): ? Filter
    {
        if (is_null($filter)) {
            return $filter;
        }

        $filterAsArray = $filter->toArray();
        $filterAsArray['field'] = Item::getPathByField($filterAsArray['field']);

        return Filter::createFromArray($filterAsArray);
    }
311864
public function filter($key, $filter=null, $option=null) {
		if (is_int(strpos($key,'.'))) {
			list($key,$fkey) = explode('.',$key,2);
			if (!isset($this->relFilter[$key.'.']))
				$this->relFilter[$key.'.'] = array();
			$this->relFilter[$key.'.'][$fkey] = array($filter,$option);
		} else
			$this->relFilter[$key] = array($filter,$option);
		return $this;
	}
1619
protected function buildFilter($field, $type, $filter, $value)
    {
        if (strlen($field) == 0)
            throw new \Exception("Empty 'field'");
        if (strlen($type) == 0)
            throw new \Exception("Empty 'type'");

        if ($type == Table::TYPE_DATETIME) {
            if ($filter == Table::FILTER_BETWEEN
                    && is_array($value) && count($value) == 2) {
                $value = [
                    $value[0] ? new \DateTime('@' . $value[0]) : null,
                    $value[1] ? new \DateTime('@' . $value[1]) : null,
                ];
                if ($value[0] && $this->getDbTimezone())
                    $value[0]->setTimezone(new \DateTimeZone($this->getDbTimezone()));
                if ($value[1] && $this->getDbTimezone())
                    $value[1]->setTimezone(new \DateTimeZone($this->getDbTimezone()));
            } else if ($filter != Table::FILTER_BETWEEN
                    && !is_array($value)) {
                $value = new \DateTime('@' . $value);
                if ($this->getDbTimezone())
                    $value->setTimezone(new \DateTimeZone($this->getDbTimezone()));
            } else {
                return false;
            }
        } else {
            if ($filter == Table::FILTER_BETWEEN) {
                if (!is_array($value) || count($value) != 2)
                    return false;
            } else if (is_array($value)) {
                return false;
            }
        }

        if (!isset($this->sqlAnds[$field]))
            $this->sqlAnds[$field] = [];

        $paramBaseName = 'dt_' . str_replace('.', '_', $field);
        switch ($filter) {
            case Table::FILTER_LIKE:
                $param = ':' . $paramBaseName . '_like';
                $this->sqlAnds[$field][] = "$field LIKE $param";
                $this->sqlParams[$param] = '%' . $value . '%';
                break;
            case Table::FILTER_EQUAL:
                $param = ':' . $paramBaseName . '_equal';
                $this->sqlAnds[$field][] = "$field = $param";
                $this->sqlParams[$param] = $value;
                break;
            case Table::FILTER_BETWEEN:
                $ands = [];
                if ($value[0] !== null) {
                    $param = ':' . $paramBaseName . '_begin';
                    $ands[] = "$field >= $param";
                    $this->sqlParams[$param] = $value[0];
                }
                if ($value[1] !== null) {
                    $param = ':' . $paramBaseName . '_end';
                    $ands[] = "$field <= $param";
                    $this->sqlParams[$param] = $value[1];
                }
                $this->sqlAnds[$field][] = join(' AND ', $ands);
                break;
            case Table::FILTER_NULL:
                $this->sqlAnds[$field][] = "$field IS NULL";
                break;
            default:
                throw new \Exception("Unknown filter: $filter");
        }

        return true;
    }
365006
public function getFilter($filter)
    {
        $result = null;

        if(isset($this->__filters[$filter])) {
            $result = $this->__filters[$filter];
         }

        return $result;
    }
119161
public function get($filter, $cols = null) {
		$query = $this->newSelect();
		if (is_array($cols)) {
			$query->addColumns(...$cols);
		}
		if (!is_array($filter)) {
			$query->where(field($this->_primary_key)->eq($filter));
		} else {
			foreach ($filter as $k => $v) {
				$query->andWhere(field($k)->eq($v));
			}
		}
		$query->limit(1);
		$result = $this->execute($query);
		return count($result) > 0 ? current($result) : null;
	}
69437
public function filter($string, $filter = null)
    {
        if (!isset($filter)) {
            $filter = $this->current_filter;
        }

        $delimiter = $this->config('teaser_delimiter', '<!--teaser-->');
        $string = str_replace($delimiter, htmlspecialchars($delimiter), $string);
        return $this->filter->run($string, $filter);
    }
808297
public function setFilter($filter = null)
    {
        $this->filter = is_callable($filter) ? $filter : null;

        return $this;
    }
213003
private function resolveFilterType(Filter\FilterTypeInterface $type)
    {
        $typeExtensions = [];
        $parentType = $type->getParent();
        $class = get_class($type);

        foreach ($this->extensions as $extension) {
            $typeExtensions = array_merge(
                $typeExtensions,
                $extension->getFilterTypeExtensions($class)
            );
        }

        return $this->resolvedTypeFactory->createResolvedFilterType(
            $type,
            $typeExtensions,
            $parentType ? $this->getFilterType($parentType) : null
        );
    }
1323999
public function objectsList($filter = null, $params = null)
    {
        //====================================================================//
        // Stack Trace
        Splash::log()->trace();

        //====================================================================//
        // Prepare Query Builder
        /** @var QueryBuilder $queryBuilder */
        $queryBuilder = $this->repository->createQueryBuilder('c');
        // Setup Results Offset
        if (isset($params['offset']) && is_int($params['offset'])) {
            $queryBuilder->setFirstResult($params['offset']);
        }
        // Limit Results Number
        if (isset($params['max']) && is_int($params['max'])) {
            $queryBuilder->setMaxResults($params['max']);
        }

        //====================================================================//
        // Add List Filters
        if (!empty($filter)) {
        }

        //====================================================================//
        // Load Objects List
        $rawData = $queryBuilder->getQuery()->getResult();

        //====================================================================//
        // Parse Data on Result Array
        $response = array();
        foreach ($rawData as $object) {
            $response[] = $this->getObjectListArray($object);
        }

        //====================================================================//
        // Parse Meta Infos on Result Array
        $response['meta'] = array(
            'total' => count($rawData),
            'current' => $this->getTotalCount(),
        );

        //====================================================================//
        // Return result
        return $response;
    }
332946
protected function getUserEventsFilter(string $filter = null)
    {
        $mappingConfiguration = new PropertyMappingConfiguration();

        return $this->convertEventsFilter($mappingConfiguration, $filter);
    }
945453
public function getByKey(string $key, AbstractFilter $filter = null)
    {
        return $this->children->getByKey($key, $filter);
    }
1109326
public function filter($filter)
    {
        if (is_array($filter) != true) {
            $filter = [$filter];
        }

        foreach ($filter as $item) {
            $this->filters[] = str_replace('./', $this->outpath . '/', $item);
        }

        return $this;
    }
341097
protected function parseFilter($filter, array $options)
	{
		$parameters = array();

		$original = $filter;

		if ($filter instanceof Closure)
		{
			$filter = $this->registerClosureFilter($filter);
		}
		elseif ($this->isInstanceFilter($filter))
		{
			$filter = $this->registerInstanceFilter($filter);
		}
		else
		{
			list($filter, $parameters) = Route::parseFilter($filter);
		}

		return compact('original', 'filter', 'parameters', 'options');
	}
523688
public function filter($filter)
    {
        if (is_array($filter)) {
            $filter = new Filter($filter);
        }
        $this->filter = $filter;
        return $this;
    }
720871
public static function toProtobuf($object, $filter = NULL)
	{
		$output = '';

		if (isset($object->error) && ($filter === null || isset($filter['error']))) {
			$output .= "\x0a";
			$output .= Binary::encodeVarint(strlen($object->error));
			$output .= $object->error;
		}

		if (isset($object->file) && ($filter === null || isset($filter['file']))) {
			foreach ($object->file instanceof \Traversable ? $object->file : (array)$object->file as $k => $v) {
				$output .= "\x7a";
				$buffer = FileMeta::toProtobuf($v, $filter === null ? null : $filter['file']);
				$output .= Binary::encodeVarint(strlen($buffer));
				$output .= $buffer;
			}
		}

		return $output;
	}