src/DcGeneral/Data/FilterBuilder.php
private function getFilterForComparingOperator($attribute, IFilter $filter, $operation)
    {
        if ($attribute) {
            switch ($operation['operation']) {
                case '=':
                    $filter->addFilterRule(new SearchAttribute(
                        $attribute,
                        $operation['value'],
                        $this->getMetaModel()->getAvailableLanguages() ?: array()
                    ));
                    return;

                case '>':
                    $filter->addFilterRule(new GreaterThan(
                        $attribute,
                        $operation['value']
                    ));
                    return;

                case '<':
                    $filter->addFilterRule(new LessThan(
                        $attribute,
                        $operation['value']
                    ));
                    return;

                default:
                    throw new \RuntimeException(
                        'Error processing filter array - unknown operation ' .
                        var_export($operation['operation'], true),
                        1
                    );
            }
        }

        $columns = $this->connection->getSchemaManager()->listTableColumns($this->getMetaModel()->getTableName());
        if ($columns[$operation['property']]) {
            // System column?
            $filter->addFilterRule(new SimpleQuery(
                sprintf(
                    'SELECT id FROM %s WHERE %s %s?',
                    $this->getMetaModel()->getTableName(),
                    $operation['property'],
                    $operation['operation']
                ),
                array($operation['value']),
                'id',
                $this->connection
            ));

            return;
        }

        throw new \RuntimeException(
            'Error processing filter array - unknown property ' . var_export($operation['property'], true),
            1
        );
    }
private function getFilterForComparingOperator($attribute, IFilter $filter, $operation)
    {
        if ($attribute) {
            switch ($operation['operation']) {
                case '=':
                    $filter->addFilterRule(new SearchAttribute(
                        $attribute,
                        $operation['value'],
                        $this->getMetaModel()->getAvailableLanguages() ?: array()
                    ));
                    return;

                case '>':
                    $filter->addFilterRule(new GreaterThan(
                        $attribute,
                        $operation['value']
                    ));
                    return;

                case '<':
                    $filter->addFilterRule(new LessThan(
                        $attribute,
                        $operation['value']
                    ));
                    return;

                default:
                    throw new \RuntimeException(
                        'Error processing filter array - unknown operation ' .
                        var_export($operation['operation'], true),
                        1
                    );
            }
        }

        $columns = $this->connection->getSchemaManager()->listTableColumns($this->getMetaModel()->getTableName());
        if ($columns[$operation['property']]) {
            // System column?
            $filter->addFilterRule(new SimpleQuery(
                sprintf(
                    'SELECT id FROM %s WHERE %s %s?',
                    $this->getMetaModel()->getTableName(),
                    $operation['property'],
                    $operation['operation']
                ),
                array($operation['value']),
                'id',
                $this->connection
            ));

            return;
        }

        throw new \RuntimeException(
            'Error processing filter array - unknown property ' . var_export($operation['property'], true),
            1
        );
    }
Build the sub query for a comparing operator like =,<,>.

@param IAttribute $attribute The attribute.

@param IFilter    $filter    The filter to add the operations to.

@param array      $operation The operation to convert.

@return void

@throws \RuntimeException When the operation can not be parsed.