src/DcGeneral/Data/FilterBuilder.php
protected function buildNativeSqlProcedure(FilterBuilderSql $procedure, $children)
    {
        $skipped   = array();
        $metaModel = $this->getMetaModel();
        $tableName = $metaModel->getTableName();
        foreach ($children as $child) {
            // If there is an attribute contained within this rule, skip it.
            if (isset($child['property']) && $metaModel->hasAttribute($child['property'])) {
                $skipped[] = $child;

                continue;
            }

            // Try to parse the sub procedure and extract as much as possible.
            if (('AND' === $child['operation']) || ('OR' === $child['operation'])) {
                if (null === $child['children']) {
                    continue;
                }

                $subProcedure = new FilterBuilderSql($tableName, $child['operation'], $this->connection);
                $subSkipped   = $this->buildNativeSqlProcedure($subProcedure, $child['children']);

                if (count($subSkipped) !== count($child['children'])) {
                    $procedure->addSubProcedure($subProcedure);
                }

                if (!empty($subSkipped)) {
                    $skipped += $subSkipped;
                }

                continue;
            }

            $procedure->addChild($child);
        }

        return $skipped;
    }
protected function buildNativeSqlProcedure(FilterBuilderSql $procedure, $children)
    {
        $skipped   = array();
        $metaModel = $this->getMetaModel();
        $tableName = $metaModel->getTableName();
        foreach ($children as $child) {
            // If there is an attribute contained within this rule, skip it.
            if (isset($child['property']) && $metaModel->hasAttribute($child['property'])) {
                $skipped[] = $child;

                continue;
            }

            // Try to parse the sub procedure and extract as much as possible.
            if (('AND' === $child['operation']) || ('OR' === $child['operation'])) {
                if (null === $child['children']) {
                    continue;
                }

                $subProcedure = new FilterBuilderSql($tableName, $child['operation'], $this->connection);
                $subSkipped   = $this->buildNativeSqlProcedure($subProcedure, $child['children']);

                if (count($subSkipped) !== count($child['children'])) {
                    $procedure->addSubProcedure($subProcedure);
                }

                if (!empty($subSkipped)) {
                    $skipped += $subSkipped;
                }

                continue;
            }

            $procedure->addChild($child);
        }

        return $skipped;
    }
Calculate a native SQL sub procedure.

@param FilterBuilderSql $procedure The procedure to which to append to.

@param array            $children  The children to calculate.

@return array