Extracts UrlAlias objects from database $rows.

@param array $rows

@return \eZ\Publish\SPI\Persistence\Content\UrlAlias[]
349471
public function extractUrlAliasListFromData(array $rows)
    {
        $urlAliases = array();
        foreach ($rows as $row) {
            $urlAliases[] = $this->extractUrlAliasFromData($row);
        }

        return $urlAliases;
    }
1018383
private function createModels($rows)
    {
        $models = [];
        if ($this->asArray) {
            if ($this->indexBy === null) {
                return $rows;
            }
            foreach ($rows as $row) {
                if (is_string($this->indexBy)) {
                    $key = isset($row['fields'][$this->indexBy]) ? reset($row['fields'][$this->indexBy]) : $row['_source'][$this->indexBy];
                } else {
                    $key = call_user_func($this->indexBy, $row);
                }
                $models[$key] = $row;
            }
        } else {
            /* @var $class ActiveRecord */
            $class = $this->modelClass;
            if ($this->indexBy === null) {
                foreach ($rows as $row) {
                    $model = $class::instantiate($row);
                    $modelClass = get_class($model);
                    $modelClass::populateRecord($model, $row);
                    $models[] = $model;
                }
            } else {
                foreach ($rows as $row) {
                    $model = $class::instantiate($row);
                    $modelClass = get_class($model);
                    $modelClass::populateRecord($model, $row);
                    if (is_string($this->indexBy)) {
                        $key = $model->{$this->indexBy};
                    } else {
                        $key = call_user_func($this->indexBy, $model);
                    }
                    $models[$key] = $model;
                }
            }
        }

        return $models;
    }
336505
protected function buildEmbeddedCollection(array $rows): Collection
    {
        return collect($rows)->map(function ($attributes) {
            return $this->buildEmbeddedObject($attributes);
        });
    }
721118
private function buildTree(array $rows, $parent = null)
    {
        $tree = [];

        foreach ($rows as &$row) {
            if ($row['parent'] == $parent) {
                $hasChildren        = $this->propertyAccessor->getValue($row, "[{$this->options['children_column']}]");
                $row['hasChildren'] = (bool)($hasChildren > 0);
                $row['children']    = $this->buildTree($rows, $row['id']);
                $tree[]             = $row;
            }
        }

        return $tree;
    }
868153
public function toFeatureCollection($rows)
    {
        /** @var Feature $feature */
        foreach ($rows as $k => $feature) {
            $rows[ $k ] = $feature->toGeoJson(true);
        }
        return array("type"     => "FeatureCollection",
                     "features" => $rows);
    }
358423
private function parseIncluding($rows)
	{
		$subs       = null;
		$constraint = null;
		foreach ($this->includes as $relationship)
		{
			// Check for array, meaning we have relationship_name => constraint
			if (is_array($relationship))
			{
				list($relationship, $constraint) = $relationship;
			}

			// Parse for nested relationships
			if (strpos($relationship, '.'))
			{
				list($relationship, $subs) = explode('.', $relationship, 2);
			}

			// If we have subs and a constraint, the constraint should apply to the subs, not the intermediate relation
			if (isset($subs) && isset($constraint))
			{
				$subs       = [$subs, $constraint];
				$constraint = null;
			}

			// Get the actual rows
			$rows = $this->$relationship()->seedWithRelation($rows, $relationship, $constraint, $subs);

			// Reset some vars
			$subs       = null;
			$constraint = null;
		}

		return $rows;
	}
962714
public function parseResults($rows)
    {
        $results = array();

        //convert the resulting set into arrays
        foreach ($rows as $item) {
            //iterate over the included and related columns
            $arr = array();

            $this->parseOnTableColumns($item, $arr);

            //then grab the computed, unsortable columns
            $this->parseComputedColumns($item, $arr);

            $results[] = $arr;
        }

        return $results;
    }
468158
protected function enrichWithMany(array $rows)
    {
        $manyFields = $this->getManyFields();
        $idToData   = [];
        foreach ($rows as $row) {
            foreach ($manyFields as $manyField) {
                $row[$manyField] = [];
            }
            $idToData[$row['id']] = $row;
        }
        foreach ($manyFields as $manyField) {
            $this->enrichWithManyField($idToData, $manyField);
        }
        return array_values($idToData);
    }
772083
public function export(array &$rows)
    {
        $config     = $this->getConfiguration('export');
        $fieldNames = isset($config['fields']) ? $config['fields'] : null;
        $result     = array();

        if ($fieldNames) {
            foreach ($rows as &$row) {
                $exportRow = array();
                foreach ($fieldNames as $fieldName => $fieldCode) {
                    $exportRow[ $fieldName ] = $this->evaluateField($row, $fieldCode);
                }
                $result[] = $exportRow;
            }
        } else {
            $result = &$rows;
        }

        return $result;
    }
1334125
public function readRows(array $rows, array &$fetched = null): array
    {
        $list = [];
        foreach ($rows as $key => $row) {
            if (null === $row || (!\is_object($row) && !\is_array($row))) {
                // Only load rows which haven't been loaded before.
                $key = (string)$key;
                if (!$this->hasKey($key)) {
                    $list[$key] = null;
                } else {
                    $path = $this->getPathFromKey($key);
                    $file = $this->getFile($path);
                    $list[$key] = $this->loadFile($file);
                }
                if (null !== $fetched) {
                    $fetched[$key] = $list[$key];
                }
            } else {
                // Keep the row if it has been loaded.
                $list[$key] = $row;
            }
        }

        return $list;
    }
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;
    }
931194
public static function makeCollection($rows)
    {
        $collection = [];
        foreach ($rows as $row)
        {
            $obj = new static;
            $collection[] = $obj->setAttributes(get_object_vars($row));
        }
        return $collection;
    }
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;
	}
247207
public function extractContentFromRows(array $rows, array $nameRows, $prefix = 'ezcontentobject_')
    {
        $versionedNameData = array();
        foreach ($nameRows as $row) {
            $contentId = (int)$row['ezcontentobject_name_contentobject_id'];
            $versionNo = (int)$row['ezcontentobject_name_content_version'];
            $versionedNameData[$contentId][$versionNo][$row['ezcontentobject_name_content_translation']] = $row['ezcontentobject_name_name'];
        }

        $contentInfos = array();
        $versionInfos = array();
        $fields = array();

        foreach ($rows as $row) {
            $contentId = (int)$row["{$prefix}id"];
            if (!isset($contentInfos[$contentId])) {
                $contentInfos[$contentId] = $this->extractContentInfoFromRow($row, $prefix);
            }
            if (!isset($versionInfos[$contentId])) {
                $versionInfos[$contentId] = array();
            }

            $versionId = (int)$row['ezcontentobject_version_id'];
            if (!isset($versionInfos[$contentId][$versionId])) {
                $versionInfos[$contentId][$versionId] = $this->extractVersionInfoFromRow($row);
            }

            $fieldId = (int)$row['ezcontentobject_attribute_id'];
            if (!isset($fields[$contentId][$versionId][$fieldId])) {
                $fields[$contentId][$versionId][$fieldId] = $this->extractFieldFromRow($row);
            }
        }

        $results = array();
        foreach ($contentInfos as $contentId => $contentInfo) {
            foreach ($versionInfos[$contentId] as $versionId => $versionInfo) {
                // Fallback to just main language name if versioned name data is missing
                if (isset($versionedNameData[$contentId][$versionInfo->versionNo])) {
                    $names = $versionedNameData[$contentId][$versionInfo->versionNo];
                } else {
                    $names = [$contentInfo->mainLanguageCode => $contentInfo->name];
                }

                $content = new Content();
                $content->versionInfo = $versionInfo;
                $content->versionInfo->names = $names;
                $content->versionInfo->contentInfo = $contentInfo;
                $content->fields = array_values($fields[$contentId][$versionId]);
                $results[] = $content;
            }
        }

        return $results;
    }
667072
protected function fillRows(array $rows)
    {
        $row = [];
        $seriesOptions = $this->seriesOptions();
        foreach ($seriesOptions as $serieId => $serieOpts) {
            $row[$serieId] = '0';
        }

        $starts = clone($this->startDate());
        $ends = $this->endDate();
        while ($starts < $ends) {
            $x = $starts->format($this->dateFormat());
            if (!isset($rows[$x])) {
                $rows[$x] = $row;
            }
            $starts->add($this->dateInterval());
        }
        ksort($rows);
        return $rows;
    }
391537
private function formatRows(array $rows) {
        foreach ($rows as $rowIndex => $row) {
            $type = $row['type'];
            $indent = $this->indent;
            $gutter = str_repeat(' ', $this->gutter);
            $verticalSeparator = $this->verticalSeparator;

            if ($type === '@section') {
                $indent = $this->sectionIndent;
            }

            foreach ($row['cols'] as $colIndex => $col) {
                if ($colIndex === 0) {
                    $col = str_repeat(' ', $indent) . $col;
                } else {
                    $col = $gutter . $verticalSeparator . $gutter . $col;
                }

                array_set($row['cols'], $colIndex, $col);
            }

            array_set($rows, $rowIndex, $row);
        }

        return $rows;
    }
865704
public function prepareResults(&$rows, $srid = null)
    {
        $hasSrid = $srid != null;

        if ($this->driver instanceof Oracle) {
            Oracle::transformColumnNames($rows);
        }

        foreach ($rows as $key => &$row) {
            $row = $this->create($row);
            if ($hasSrid) {
                $row->setSrid($srid);
            }
        }

        return $rows;
    }