<commit_before><?php

namespace {{ table.schema.namespace }}\Base;

use Rocket\ORM\Rocket;
use Rocket\ORM\Model\Query\Query;

/**
 * Generated by Rocket ORM.
 * Do not edit this file, use the generation command instead.
 *
 * "{{ table.schema.database }}.{{ table.name }}" base query model
 */
class Base{{ table.phpName }}Query extends Query
{
    const MODEL_NAMESPACE = '\\{{ table.schema.escapedNamespace }}\\{{ table.phpName }}';

    /**
     * @param string $alias The query alias
     *
     * @return \{{ table.schema.namespace }}\{{ table.phpName }}Query
     */
    public static function create($alias = '{{ table.phpName }}')
    {
        return new self($alias, self::MODEL_NAMESPACE);
    }

    /**
     * @param \PDO $con
     *
     * @return array
     *
     * @throws \Exception
     */
    public function find(\PDO $con = null)
    {
        // Building query
        $query = 'SELECT '
            {% for i,column in table.columns -%}
            {%- if loop.last -%}
                . $this->alias . '.{{ column.name }}'
            {%- else -%}
                . $this->alias . '.{{ column.name }}, '
            {% endif -%}
        {%- endfor -%}
        {{ "\n        " }};

        $hasRelationWith = 0 < sizeof($this->with);
        if ($hasRelationWith) {
            $query .= $this->buildRelationWith();
        }

        $query .= ' FROM `{{ table.schema.database }}`.`{{ table.name }}` AS ' . $this->alias;

        if (0 < sizeof($this->joins)) {
            $query .= $this->buildRelationClauses();
        }

        $hasClauses = 0 < sizeof($this->clauses);
        if ($hasClauses) {
            $query .= $this->buildClauses();
        }

        $query .= $this->buildLimit();

        // Processing
        try {
            if (null == $con) {
                $con = Rocket::getConnection($this->getTableMap()->getConnectionName());
            }

            $stmt = $con->prepare($query);
            if ($hasClauses) {
                foreach ($this->clauses as $i => $clauseParams) {
                    $stmt->bindValue(':param_' . $i, $clauseParams['value'], \PDO::PARAM_STR);
                }
            }

            $stmt->execute();
        } catch (\Exception $e) {
            throw $e;
        }

        $objects = [];
        while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
            if ($hasRelationWith) {
                $tmpRow = [];
                foreach ($row as $columnName => $value) {
                    if (false !== strpos($columnName, '.')) {
                        $params = explode('.', $columnName);
                        $this->hydrateRelationValue($tmpRow, $params[0], $params[1], $value, $this->with[$params[0]]['from']);
                    } else {
                        $tmpRow[$columnName] = $value;
                    }
                }

                $row = $tmpRow;
                unset($tmpRow);
            }

            //$objects[] = new RocketObject($row, self::MODEL_NAMESPACE);
            $objects[] = $row;
        }

        $stmt->closeCursor();
        $this->clear();

        if (1 === $this->limit) {
            return $objects[0];
        }

        return $objects;
    }
}<commit_msg>fix: use RocketObject in query class find method.<commit_after><?php

namespace {{ table.schema.namespace }}\Base;

use Rocket\ORM\Rocket;
use Rocket\ORM\Model\Object\RocketObject;
use Rocket\ORM\Model\Query\Query;

/**
 * Generated by Rocket ORM.
 * Do not edit this file, use the generation command instead.
 *
 * "{{ table.schema.database }}.{{ table.name }}" base query model
 */
class Base{{ table.phpName }}Query extends Query
{
    const MODEL_NAMESPACE = '\\{{ table.schema.escapedNamespace }}\\{{ table.phpName }}';

    /**
     * @param string $alias The query alias
     *
     * @return \{{ table.schema.namespace }}\{{ table.phpName }}Query
     */
    public static function create($alias = '{{ table.phpName }}')
    {
        return new self($alias, self::MODEL_NAMESPACE);
    }

    /**
     * @param \PDO $con
     *
     * @return array
     *
     * @throws \Exception
     */
    public function find(\PDO $con = null)
    {
        // Building query
        $query = 'SELECT '
            {% for i,column in table.columns -%}
            {%- if loop.last -%}
                . $this->alias . '.{{ column.name }}'
            {%- else -%}
                . $this->alias . '.{{ column.name }}, '
            {% endif -%}
        {%- endfor -%}
        {{ "\n        " }};

        $hasRelationWith = 0 < sizeof($this->with);
        if ($hasRelationWith) {
            $query .= $this->buildRelationWith();
        }

        $query .= ' FROM `{{ table.schema.database }}`.`{{ table.name }}` AS ' . $this->alias;

        if (0 < sizeof($this->joins)) {
            $query .= $this->buildRelationClauses();
        }

        $hasClauses = 0 < sizeof($this->clauses);
        if ($hasClauses) {
            $query .= $this->buildClauses();
        }

        $query .= $this->buildLimit();

        // Processing
        try {
            if (null == $con) {
                $con = Rocket::getConnection($this->getTableMap()->getConnectionName());
            }

            $stmt = $con->prepare($query);
            if ($hasClauses) {
                foreach ($this->clauses as $i => $clauseParams) {
                    $stmt->bindValue(':param_' . $i, $clauseParams['value'], \PDO::PARAM_STR);
                }
            }

            $stmt->execute();
        } catch (\Exception $e) {
            throw $e;
        }

        $objects = [];
        while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
            if ($hasRelationWith) {
                $tmpRow = [];
                foreach ($row as $columnName => $value) {
                    if (false !== strpos($columnName, '.')) {
                        $params = explode('.', $columnName);
                        $this->hydrateRelationValue($tmpRow, $params[0], $params[1], $value, $this->with[$params[0]]['from']);
                    } else {
                        $tmpRow[$columnName] = $value;
                    }
                }

                $row = $tmpRow;
                unset($tmpRow);
            }

            $objects[] = new RocketObject($row, self::MODEL_NAMESPACE);
        }

        $stmt->closeCursor();
        $this->clear();

        if (1 === $this->limit) {
            return $objects[0];
        }

        return $objects;
    }
}
{'fraction_non_alphanumeric': 0.17153905645784995, 'fraction_numerical': 0.0024748646558391337, 'mean_word_length': 1.5218408736349454, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1921273', 'n_tokens_mistral': 1952, 'n_tokens_neox': 1866, 'n_words': 373}