Converts found rows into model instances.

@param array $rows

@return array|ModelInterface[]
436369
public function createModels($rows)
    {
        $models = [];
        foreach ($rows as $row) {
            $models[] = $this->createModel($row);
        }

        return $models;
    }
336505
protected function buildEmbeddedCollection(array $rows): Collection
    {
        return collect($rows)->map(function ($attributes) {
            return $this->buildEmbeddedObject($attributes);
        });
    }
901762
public function extractRelationsFromRows(array $rows)
    {
        $relations = array();

        foreach ($rows as $row) {
            $id = (int)$row['ezcontentobject_link_id'];
            if (!isset($relations[$id])) {
                $relations[$id] = $this->extractRelationFromRow($row);
            }
        }

        return $relations;
    }
177011
public function setRows(array $rows)
    {
        if (isset($rows['_head'])) {
            $this->setHeading($rows['_head']);
            unset($rows['_head']);
        }
        
        if (!empty($rows)) {
            foreach($rows as $row) {
                $this->setRow($row);
            }
        }
        
        return $this;
    }
158647
public function extractGroupsFromRows(array $rows)
    {
        $groups = array();

        foreach ($rows as $row) {
            $group = new Group();
            $group->id = (int)$row['id'];
            $group->created = (int)$row['created'];
            $group->creatorId = (int)$row['creator_id'];
            $group->modified = (int)$row['modified'];
            $group->modifierId = (int)$row['modifier_id'];
            $group->identifier = $row['name'];

            $groups[] = $group;
        }

        return $groups;
    }
273104
public function extractLanguageCodesFromData(array $rows): array
    {
        $languageMask = 0;
        foreach ($rows as $row) {
            $languageMask |= $row['lang_mask'];
        }

        return $this->languageMaskGenerator->extractLanguageCodesFromMask($languageMask);
    }
108438
public function setRows($rows)
    {
        $this->rows = $rows;
        $this->rowsString = sprintf('`%s`', implode('`,`', $this->rows));

        return $this;
    }
353012
public function loadAllObjects(LoadingContext $context, array $rows) : array
    {
        $objects = [];

        foreach ($rows as $key => $row) {
            $objects[$key] = $this->constructNewObjectFromRow($row);
        }

        $this->loadAll($context, $objects, $rows);

        return $objects;
    }
580799
public function normalizeColumns(array &$rows) : array
    {
        $maxNumColumns = 0;

        // Find the max number of columns that appear in any given row
        foreach ($rows as $row) {
            $maxNumColumns = max($maxNumColumns, count($row));
        }

        $maxLengths = array_pad([], $maxNumColumns, 0);

        // Normalize the number of columns in each row
        foreach ($rows as &$row) {
            $row = array_pad($row, $maxNumColumns, '');
        }

        // Get the length of the longest value in each column
        foreach ($rows as &$row) {
            foreach ($row as $column => &$value) {
                $value = trim($value);
                $maxLengths[$column] = max($maxLengths[$column], mb_strlen($value));
            }
        }

        return $maxLengths;
    }
1156319
public function batchInsert($rows)
    {
        $insertedIds = $this->db->batchInsert($this->name, $rows);

        foreach ($rows as $key => $row) {
            $rows[$key]['_id'] = $insertedIds[$key];
        }

        return $rows;
    }
28084
protected function valueLists( $rows, $columns ) {

        $lists = array();

        foreach ( $rows as $row ) {

            $values = array();

            foreach ( $columns as $column ) {

                $values[] = $this->quote( @$row[ $column ] );

            }

            $lists[] = "( " . implode( ", ", $values ) . " )";

        }

        return $lists;

    }
665340
private function seed($rows)
	{
		// Set our constrained (pre-fetched data) back on the rows
		foreach ($this->data as $relationship => $data)
		{
			$rows = $this->$relationship()->seedWithData($rows, $data, $relationship);
		}

		return $rows;
	}
349471
public function extractUrlAliasListFromData(array $rows)
    {
        $urlAliases = array();
        foreach ($rows as $row) {
            $urlAliases[] = $this->extractUrlAliasFromData($row);
        }

        return $urlAliases;
    }
637738
private function createBottomHeadingRow(array $rows)
    {
        $elements = array();

        if ($this->options[self::GRID_PARAM_BATCH] === true) {
            $elements[] = $this->createColumn(null, null);
        }

        foreach ($rows as $row) {
            // Ignore if configuration for current column isn't provided
            if (!$this->hasColumnConfiguration($row[self::GRID_PARAM_COLUMN])) {
                continue;
            }

            // Find out whether a column needs to have a filter
            $filter = $this->findOptionByColumn($row[self::GRID_PARAM_COLUMN], self::GRID_PARAM_FILTER);

            // Use provided name if available, otherwise name it as a column
            $inputName = isset($row[self::GRID_PARAM_NAME]) ? $row[self::GRID_PARAM_NAME] : $row[self::GRID_PARAM_COLUMN];

            // Full-qualified input name
            $name = $this->createInputName(self::GRID_PARAM_FILTER, $inputName);

            if ($filter) {
                // If filter is array, then assume its for select
                $selected = $this->filter->get($inputName);

                if (is_array($filter)) {
                    $filter = array_replace(array('' => ''), $filter);
                    $elements[] = $this->createInput('createHeader', $row[self::GRID_PARAM_COLUMN], $name, $selected, $filter);
                    // If explicit boolean filter provided
                } else if ($filter === 'boolean') {
                    $options = array(
                        '0' => 'No',
                        '1' => 'Yes'
                    );

                    // Translate boolean values on demand
                    if ($this->hasTranslator()) {
                        $options = $this->translator->translateArray($options);
                    }

                    $filter = array_replace(array('' => ''), $options);
                    $elements[] = $this->createInput('createHeader', $row[self::GRID_PARAM_COLUMN], $name, $selected, $filter);
                    
                } else {
                    $elements[] = $this->createInput('createHeader', $row[self::GRID_PARAM_COLUMN], $name, $selected);
                }

            } else {
                $elements[] = $this->createColumn(null, '');
            }
        }

        if ($this->hasActions()) {
            $elements[] = $this->createTextHeader('');
        }

        return $this->createTableRow($elements);
    }
868153
public function toFeatureCollection($rows)
    {
        /** @var Feature $feature */
        foreach ($rows as $k => $feature) {
            $rows[ $k ] = $feature->toGeoJson(true);
        }
        return array("type"     => "FeatureCollection",
                     "features" => $rows);
    }
992157
protected function getColumns( $rows ) {

        $columns = array();

        foreach ( $rows as $row ) {

            foreach ( $row as $column => $value ) {

                $columns[ $column ] = true;

            }

        }

        return array_keys( $columns );

    }
971873
private function convertColumns(array $row)
    {
        $result = [];

        foreach ($row as $fieldName => $value) {
            if (is_null($value)) {
                $result[$fieldName] = null;
                continue;
            }
            switch($this->columnTypes[$fieldName]) {
                case self::BOOL:
                    $value = is_null($value) ? null : $value == 't';
                    break;
                case self::INTEGER:
                case self::SMALLINT:
                case self::BIGINT:
                    $value = (int) $value;
                    break;
                case self::NUMERIC:
                    $value = (float) $value;
                    break;
                case self::JSON:
                    $value = json_decode($value, true);
                    break;
                case self::HSTORE:
                    $value = self::fromHStore($value);
                    break;
                case self::DATE:
                case self::TIMESTAMP:
                case self::TIMESTAMPTZ:
                    $value = self::fromTimestamp($value);
                    break;
                case self::SMALLINT_ARRAY:
                case self::INTEGER_ARRAY:
                    $value = self::fromArray($value);
                    if (!is_null($value)) {
                        $value = array_map(function($a) {
                            return $a === 'NULL' ? null : intval($a);
                        }, $value);
                    }
                    break;
                case self::BIGINT_ARRAY:
                case self::NUMERIC_ARRAY:
                    $value = self::fromArray($value);
                    if (!is_null($value)) {
                        $value = array_map(function($a) {
                            return $a === 'NULL' ? null : doubleval($a);
                        }, $value);
                    }
                    break;
                case self::TEXT_ARRAY:
                case self::VARCHAR_ARRAY:
                case self::CHAR_ARRAY:
                    $value = self::fromArray($value);
                    break;
                case self::HSTORE_ARRAY:
                    $array = self::fromArray($value);
                    $value = [];
                    foreach ($array as $val) {
                        $value[] = self::fromHStore($val);
                    }
                    break;
                case self::JSON_ARRAY:
                    $array = self::fromArray($value);
                    $value = [];
                    foreach ($array as $val) {
                        $value[] = json_decode($val, true);
                    }
                    break;
                case self::INTERVAL:
                    $value = self::fromInterval($value);
                    break;
            }

            $result[$fieldName] = $value;
        }
        return $result;
    }