converts string filter to array. string in: 'rule1:parameter1|rule2:parameter2'

@param string|array $filter
@return array
495551
public static function convertFilter($filter)
    {
        if (!$filter) {
            return array();
        }
        if (is_array($filter)) {
            return $filter;
        }

        $filter_array = array();
        $rules        = explode('|', $filter);
        foreach ($rules as $rule) {
            list($name, $arg) = self::get_name_and_arg($rule);
            $filter_array[$name] = $arg;
        }

        return $filter_array;
    }
969156
function getComments(array $filter = array())
    {
        $params = array(1, $this->username, $this->password, $filter);

        return $this->sendRequest('wp.getComments', $params);
    }
182705
protected function filterContainsZip($filter)
    {
        $return = [];

        if (
            (isset($filter->string) && preg_match('/^\d{5}(?:[-\s]\d{4})?$/', $filter->string))
            || false !== strpos(serialize($filter), 'zipcode')
        ) {
            $return = ['l.zipcode'];
        }

        return $return;
    }
290002
public function exportGroups($filter = array()) {
        $items = $this->getGroups($filter);
        $exports = array();
        foreach ($items as $item) {
            if (!empty($item['STRING_ID'])) {
                $exports[] = $this->prepareExportGroup($item);
            }

        }
        return $exports;
    }
857377
protected function filter(array $filter)
    {
        // email
        if(array_key_exists('authEmail', $filter) && strlen($filter['authEmail']) > 0) {
            $this->select->where->like('auth.auth_email', $filter['authEmail'] . '%');
        }
        
        //auth id
        if(array_key_exists('authId', $filter) && $filter['authId'] > 0) {
            $this->select->where(array(
                'history.auth_id = ?' => $filter['authId']
            ));
        }
        
        return $this;
    }
353087
private function applyFilter(Filter $filter)
    {
        list($filtered, $errors) = $filter->apply($this->value);
        if (count($errors) === 0) {
            return $filtered;
        }

        foreach ($errors as $error) {
            $this->paramErrors->append($this->paramName, $error);
        }

        return null;
    }
326646
public function getTranslatedContent(array $filter)
    {
        $content = $this->getContent($filter);

        if ($content instanceof Content) {
            return $this->translations->findTranslations($content);
        }
    }
1091896
public function getOwnMethods($filter = -1)
    {
        $return = $this->getMethods($filter);

        $traitMethods = $traitAliases = array();
        foreach ($this->getTraits() as $trait) {
            $traitAliases = array_merge($traitAliases, $this->getTraitAliases());
            foreach ($trait->getMethods($filter) as $method) {
                $traitMethods[] = $method->getName();
            }
        }

        $traitMethods = array_merge($traitMethods, array_keys($traitAliases));

        foreach ($return as $key => $val) {
            if ($val->class === $this->getName() && in_array($val->getName(), $traitMethods) === false) {
                $return[$key] = new ReflectionMethod($this->getName(), $val->getName());
            } else {
                unset($return[$key]);
            }
        }

        return array_values($return);
    }
717849
public function getFilterConfig($filter)
    {
        if (!$this->hasFilter($filter)) {
            throw new Exception("No such filter '$filter' exists.");
        }

        return isset($this->config[$filter])
            ? $this->config[$filter]
            : [];
    }
365006
public function getFilter($filter)
    {
        $result = null;

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

        return $result;
    }
1317458
public function where(callable $filter)
    {
        $filtered = [];

        foreach ($this->array as $key => $value) {
            if ($filter($key, $value) === true) {
                $filtered[$key] = $value;
            }
        }

        return $filtered;
    }
374058
private function sanitizeFilters(array $filters): array
    {
        $sanitized = array_filter($filters, function (string $name): bool {
            return isset($this->loaders[$name]);
        }, ARRAY_FILTER_USE_KEY);

        if (\count($filters) !== \count($sanitized)) {
            throw new \InvalidArgumentException(sprintf('Could not find filter(s): %s', implode(', ', array_map(function (string $name): string {
                return sprintf('"%s"', $name);
            }, array_diff(array_keys($filters), array_keys($sanitized))))));
        }

        return $sanitized;
    }
808146
public function exportHlblocks($filter = array()) {
        $items = $this->getHlblocks($filter);

        $export = array();
        foreach ($items as $item) {
            $export[] = $this->prepareExportHlblock($item);
        }

        return $export;
    }
644613
public static function getKeys($filter = []): array
    {
        /* @var $class LightModel */
        $className = get_called_class();
        $class = new $className;
        $tableKey = $class->getKeyName();

        $sql = 'SELECT ' . $tableKey . ' FROM ' . $class->getTableName() . ' WHERE 1=1';
        $params = self::handleFilter($sql, $filter, $class);

        $query = DB::getConnection()->prepare($sql);
        $query->execute($params);

        $res = [];

        foreach ($query->fetchAll() as $key => $value)
        {
            $res[] = $value[0];
        }

        return $res;
    }
373679
public function getParamsWith($filter)
    {
        // Convert $filter to array if necessary
        if (!is_array($filter)) {
            $filter = preg_split("/, */", $filter, -1, PREG_SPLIT_NO_EMPTY);
        }

        $params = $this->getParams();
        $filter = array_flip($filter);

        return array_intersect_key($params, $filter);
    }
687362
public static function decodeFilters(array $filters)
    {
        $decodedFilters = [];
        foreach ($filters as $property => $value) {
            $decodedFilters[] = ['value' => $value, 'property' => $property];
        }

        return $decodedFilters;
    }
1013669
public function filter($filter)
    {
        $callback = is_array($filter) ? $this->_filterFromArray($filter) : $filter;
        $data = array_filter($this->_data, $callback);
        return new static($data);
    }