Gets properties.

@param integer $filter Filter for the properties.
@return \Wingu\OctopusCore\Reflection\ReflectionProperty[]
184922
public function getProperties($filter = -1)
    {
        $properties = parent::getProperties($filter);
        foreach ($properties as $key => $val) {
            $properties[$key] = new ReflectionProperty($this->getName(), $val->getName());
        }

        return $properties;
    }
425292
public function filter($filter): ArrayObjectInterface
    {
        return \is_callable($filter, true) ? $this->filterCallback($filter) : $this->filterConditions($filter);
    }
1305055
protected function filterContainsEmail($filter)
    {
        $return = [];

        if (
            (isset($filter->string) && filter_var($filter->string, FILTER_VALIDATE_EMAIL))
            || false !== strpos(serialize($filter), 'email')
        ) {
            $return = ['l.email'];
        }

        return $return;
    }
954947
public function get_filter_values($filter) {
        if ($allvalues = (array) $this->get_config('filtervalues')) {
            if (isset($allvalues[$filter])) {
                return $allvalues[$filter];
            }
        }

        return [];
    }
332946
protected function getUserEventsFilter(string $filter = null)
    {
        $mappingConfiguration = new PropertyMappingConfiguration();

        return $this->convertEventsFilter($mappingConfiguration, $filter);
    }
143189
protected function getFilterResolver(string $filter): array
    {
        $class = $filter;
        $method = 'filter';

        $position = \strpos($filter, '@');

        if ($position === 0) {
            $method = 'filter'.\ucwords(\substr($filter, 1));

            return [$this, $method];
        }

        if ($position !== false) {
            list($class, $method) = \explode('@', $filter, 2);
        }

        return $this->makeFilterResolver($class, $method);
    }
531980
public static function getProducts($filter = array())
    {
        $filter = Filter::create($filter);
        return self::getCollection('/products' . $filter->toQuery(), 'Product');
    }
726541
public function get($filter)
    {
        if (false === \array_key_exists($filter, $this->filters)) {
            throw new NonExistingFilterException(sprintf('Could not find configuration for a filter: %s', $filter));
        }

        return $this->filters[$filter];
    }
1058131
public function filter($filter)
    {
        preg_match_all("/(#\w+)/", $filter, $entityNames);
        preg_match_all("/(:\w+)/", $filter, $positions);

        $entityName = is_array($entityNames[0]) && isset($entityNames[0][0]) ? ltrim($entityNames[0][0], '#') : null;
        $position   = is_array($positions[0]) && isset($positions[0][0]) ? $positions[0][0] : null;

        $i = 0;

        $filtered = [];

        foreach ($this->entities as $name => $entity) {
            if ($i === 0 && ($entityName === $name || $entityName === null) && ($position === ':first' || $position === ':highest' || $position === null)) {
                $filtered[] = $entity;
            }

            if ($position === ':any' && ($entityName === $name || $entityName === null)) {
                $filtered[] = $entity;
            }

            if ($i + 1 === $this->entities->count() && ($entityName === $name || $entityName === null) && ($position === ':last' || $position === ':lowest')) {
                $filtered[] = $entity;
            }

            $i++;
        }

        $this->filtered = $filtered;

        return $this;
    }
737165
protected function getPredicatesFromFilterCondition($filter)
    {
        $predicates = [];
        $regex = "/(^|\b)(\w+\:\w+)\.(l|u)(\b|$)/";
        foreach($filter as $key=>$condition)
        {
            if(is_string($key))
            {
                $numMatches = preg_match_all($regex, $key, $matches);
                for($i = 0; $i < $numMatches; $i++)
                {
                    if(isset($matches[2][$i]))
                    {
                        $predicates[] = $matches[2][$i];
                    }
                }
            }
            if(is_string($condition))
            {
                $numMatches = preg_match_all($regex, $condition, $matches);
                for($i = 0; $i < $numMatches; $i++)
                {
                    if(isset($matches[2][$i]))
                    {
                        $predicates[] = $matches[2][$i];
                    }
                }
            }
            elseif(is_array($condition))
            {
                array_merge($predicates, $this->getPredicatesFromFilterCondition($condition));
            }
        }
        return $predicates;
    }
970149
public static function filter(array $data, $filter): array
    {
        if (!$filter) {
            return $data;
        }

        if (is_callable($filter)) {
            return array_filter($data, $filter);
        }

        if ($filter & self::FILTER_NULL) {
            return array_filter(
                $data,
                function ($value) {
                    return $value !== null;
                }
            );
        } elseif ($filter & self::FILTER_EMPTY) {
            return array_filter(
                $data,
                function ($value) {
                    return isset($value[0]);
                }
            );
        } elseif ($filter & self::FILTER_PHP) {
            return array_filter($data);
        }

        return $data;
    }
677514
public function properties($filter = null)
    {
        if (is_null($filter))
        {
            $properties = $this->object->getProperties();
        }
        else
        {
            $properties = $this->object->getProperties($filter);
        }

        return array_map([$this, 'extractComment'], $properties);
    }
743849
public function filter($filter = 'image.filters.default')
    {
        $filters = (array) $this->get($filter, []);
        foreach ($filters as $params) {
            $params = (array) $params;
            $method = array_shift($params);
            $this->__call($method, $params);
        }
    }
550473
protected function parseFilterWithModel(FilterInterface $filter)
    {
        if ($this->hasModel()) {
            if ($filter->hasProperty()) {
                $model    = $this->model();
                $property = $filter->property();
                if (is_string($property) && $model->hasProperty($property)) {
                    $property = $model->property($property);

                    if ($property->l10n()) {
                        $filter->setProperty($property->l10nIdent());
                    }

                    if ($property->multiple()) {
                        $filter->setOperator('FIND_IN_SET');
                    }
                }
            }

            if ($filter instanceof FilterCollectionInterface) {
                $filter->traverseFilters(function (FilterInterface $expr) {
                    $this->parseFilterWithModel($expr);
                });
            }
        }

        return $filter;
    }
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;
    }
136534
private function filterPrefixer(array &$filter)
    {
        foreach ($filter as &$child) {
            if (\array_key_exists('property', $child)
                && (false === \strpos($child['property'], $this->source . '.'))
                && $this->fieldExists($child['property'])
            ) {
                $child['property'] = $this->source . '.' . $child['property'];
            }

            if (\array_key_exists('children', $child)) {
                $this->filterPrefixer($child['children']);
            }
        }
    }
1266215
public function unmapFilter(Reflection $reflection, array $filter)
    {
        $result = [];

        if (Filter::isGroup($filter)) {

            foreach ($filter as $modifier => $item) {
                $result[$modifier] = $this->unmapFilter($reflection, $item);
            }
        } else {

            foreach ($filter as $name => $item) {

                $property = $reflection->getProperty($name);
                $unmappedName = $property->getUnmapped();

                foreach ($item as $modifier => $value) {

                    if ($property->getType() !== Reflection\Property::TYPE_ARRAY
                        && in_array($modifier, [Filter::EQUAL, Filter::NOT], true)
                        && is_array($value)
                    ) {
                        // IN/NOT IN cases

                        $result[$unmappedName][$modifier] = [];
                        foreach ($value as $key => $valueVal) {
                            $result[$unmappedName][$modifier][$key] = $this->unmapValue(
                                $property,
                                $valueVal
                            );
                        }
                    } else {

                        $result[$unmappedName][$modifier] = $this->unmapValue(
                            $property,
                            $value
                        );
                    }
                }
            }
        }

        return $result;
    }