Nastaveni
@param string $filter
@param mixed $value
@return mixed
330933
public static function common(string $filter, ...$value)
	{
		if (method_exists(__CLASS__, $filter)) {
			return self::$filter(...$value);
		}
		return null;
	}
1111454
public function filter($value)
        {
            // transliteration
            $value = strtr($value, $this->transliteration);

            // change to lowercase
            if($this->transformCase) {
                $value = mb_convert_case($value, MB_CASE_LOWER, 'utf8');
            }

            // replace punctuation
            if($this->transformPunctuation) {
                $value = strtr($value, $this->punctuation);
            }

            return $value;
        }
1247004
public function filter($value)
    {
        if ($value instanceof VisibilityInterface
            && !$this->builder->isVisibilityAllowed($value->getVisibility())
        ) {
            return null;
        }

        return $value;
    }
1222131
public static function boolval($value, $filterNullOnFailure = FALSE)
	{
		return filter_var($value, FILTER_VALIDATE_BOOLEAN, $filterNullOnFailure ? FILTER_NULL_ON_FAILURE : NULL);
	}
928076
public function filter($value)
    {
        if (empty($value) && isset($this->filterData[$this->fieldToSlugFrom])) {
            $value = $this->filterData[$this->fieldToSlugFrom];
        }

        if (is_null($value)) {
            return $this->setEmpty();
        }

        $value = transliterator_transliterate($this->transliterator, $value);
        $value = iconv("UTF-8", "ASCII//TRANSLIT//IGNORE", $value);
        $value = preg_replace('/[^\w\d]+/', '-', $value);
        $value = trim($value, '-');
        return strtolower($value);
    }
41211
public function filter($value) {
        
        //Validate
        if(!is_numeric($value) && $this->options["validate"]) {
            return Filter::ERR_INVALID;
        }
        $value = (double)$value;
        
        // Validate Values to Min/Max/Decimals
        if( (!$this->options["adjust"] && $value < $this->options["min"]) ||
            (!$this->options["adjust"] && $value > $this->options["max"]) ) {
            return Filter::ERR_INVALID;
        }

        //Validate decimal count
        if($this->options["decimals"] !== false && $this->options["round"] === false) {
            $decimalcount = strpos($value,".") !== false ? strlen($value) - strpos($value,".") - 1 : 0;
            if($decimalcount != $this->options["decimals"])
                return Filter::ERR_INVALID;
        }

        // Adjust values to Min/Max
        if($this->options["adjust"] && $this->options["min"] !== false) {
            $value = max($this->options["min"], $value);
        }
        if($this->options["adjust"] && $this->options["max"] !== false) {
            $value = min($this->options["max"], $value);
        }
        
        //Round/Floor if needed
        if($this->options["decimals"] !== false && $this->options["round"] !== false) {
            switch($this->options["round"]) {
                case self::SI_NUMBER_CEIL:    $value = ceil($value * pow(10,$this->options["decimals"])) / pow(10,$this->options["decimals"]);    break;
                case self::SI_NUMBER_FLOOR:   $value = self::floor($value, $this->options["decimals"]);    break;
                case self::SI_NUMBER_ROUND:   $value = round($value, $this->options["decimals"]);    break;
            }
        }
        
        return $value;        
    }
819719
public function filter($value)
    {
        if (!is_scalar($value) && !is_array($value)) {
            return $value;
        }

        if (StringUtils::hasPcreUnicodeSupport()) {
            $pattern     = ['#(?<=(?:\p{Lu}))(\p{Lu}\p{Ll})#', '#(?<=(?:\p{Ll}|\p{Nd}))(\p{Lu})#'];
            $replacement = [$this->separator . '\1', $this->separator . '\1'];
        } else {
            $pattern     = ['#(?<=(?:[A-Z]))([A-Z]+)([A-Z][a-z])#', '#(?<=(?:[a-z0-9]))([A-Z])#'];
            $replacement = ['\1' . $this->separator . '\2', $this->separator . '\1'];
        }

        return preg_replace($pattern, $replacement, $value);
    }
1147154
public function greaterThanOrEquals($column, $value, $filter = false)
    {
        return $this->compare($column, '>=', $value, $filter);
    }
1338221
public function like($column, $value, $filter = false)
    {
        return $this->compare($column, 'LIKE', $value, $filter);
    }
1098392
public function filter($value)
    {
        return in_array($value, $this->getList(), $this->getStrict()) ? $value : null;
    }
935155
public function filter($value)
    {
        if (!is_scalar($value)) {
            return $value;
        }
        $value = (string) $value;

        return basename($value);
    }
382245
public function filter($value)
    {
        if (!is_string($value) && !is_numeric($value)) {
            return $value;
        }

        return $this->adapter->encrypt($value);
    }
95257
public function filter($value)
    {
        foreach($this->getFilters() as $index => $filter) {
            // Extract the params
            list($method, $params) = $filter;

            // If method is null, we use the index as the method name
            $method = is_null($method) ? $index : $method;

            // Build the params for the filter
            array_unshift($params, $value);

            // If it's a anonymous function
            if (!is_string($method) && is_callable($method)) {

                $value = call_user_func_array($method, $params);

                // if it's a local method
            } else {

                if (!method_exists($this, $method)) {
                    throw new \Exception('Method "'. $method .'" not found for filter : ' . $index);
                }

                $value = call_user_func_array([$this, $method], $params);
            }
        }

        return $value;
    }
1343080
public function filter($value)
    {
        $filtered = null;
        if (!$this->validate($value, $filtered))
        {
            throw new \InvalidArgumentException(
                "Not a valid value for " . $this->__toString() . ": " . WF::str($value)
            );
        }

        return $filtered;
    }
1196180
public static function where($filter, $value = null)
    {
        if (is_scalar($filter)) {
            /** @var \ManaPHP\ModelInterface $model */
            $model = Di::getDefault()->getShared(static::class);
            return static::query(null, $model)->whereEq($model->getPrimaryKey(), $filter);
        } else {
            return static::query()->where($filter, $value);
        }
    }
993163
public function filter($value)
    {
        if (!is_array($value)) {
            $ascii = new \Mmi\Filter\Ascii;
            return preg_replace('!\-+!', '-', preg_replace('/[^\p{L}\p{N}]/u', '-', strtolower(trim($ascii->filter($value), '-'))));
        }
        foreach ($value as $key => $val) {
            $value[$key] = $this->filter($val);
        }
        return $value;
    }
223740
public static function _($value, $filters = 'raw')
    {
        if (is_string($filters)) {
            $filters = Str::trim($filters);
            $filters = explode(',', $filters);

            if (count($filters) > 0) {
                foreach ($filters as $filter) {
                    $filterName = self::cmd($filter);

                    if ($filterName) {
                        if (method_exists(__CLASS__, $filterName)) {
                            $value = self::$filterName($value);
                        } else {
                            throw new Exception('Undefined filter method: ' . $filter);
                        }
                    }
                }
            }
        } elseif ($filters instanceof \Closure) {
            $value = $filters($value);
        }

        return $value;
    }