- $result = $this->dba->select(static::$table_name, [], $condition, $params);
-
- /** @var BaseModel $prototype */
- $prototype = null;
-
- $models = [];
-
- while ($record = $this->dba->fetch($result)) {
- if ($prototype === null) {
- $prototype = $this->create($record);
- $models[] = $prototype;
- } else {
- $models[] = static::$model_class::createFromPrototype($prototype, $record);
- }
- }
-
- return $models;