Extracts UserPreference objects from $rows.

@param array $rows

@return \eZ\Publish\SPI\Persistence\UserPreference\UserPreference[]
774714
public function extractUserPreferencesFromRows(array $rows): array
    {
        $userPreferences = [];
        foreach ($rows as $row) {
            $userPreferences[] = $this->extractUserPreferenceFromRow($row);
        }

        return $userPreferences;
    }
391912
public static function columnKeys($rows)
    {
        $debug = \bdk\Debug::getInstance();
        return $debug->methodTable->colKeys($rows);
    }
481610
protected function getDbEntitiesFromRowsPaginated(array $rows, $pagination)
    {
        if ($pagination) {
            $totalRowCount = $this->db->fetchValue('SELECT FOUND_ROWS()');
            return [$this->getDbEntitiesFromRows($rows), $totalRowCount];
        }

        return $this->getDbEntitiesFromRows($rows);
    }
409822
public function generate(array $rows): array
    {
        $generatedRows = [];
        foreach ($rows as $identifier => $row) {
            $generatedRows = $this->generateRowsIfNeeded($identifier, $row, $generatedRows);
        }
        return $generatedRows;
    }
197378
protected function fillUpSnippets($rows)
    {
        if ($this->snippetCallback === null || empty($rows)) {
            return $rows;
        }
        $snippetSources = call_user_func($this->snippetCallback, $rows);
        $snippets = $this->callSnippets($snippetSources);
        $snippetKey = 0;
        foreach ($rows as $key => $row) {
            $rows[$key]['snippet'] = $snippets[$snippetKey];
            $snippetKey++;
        }

        return $rows;
    }
512352
public function process(array $rows)
    {
        foreach ($this->queue as $queue) {
            // Just references
            $relation = $queue[self::PARAM_RELATION];
            $args = $queue[self::PARAM_ARGS];

            switch ($relation) {
                case 'asOneToMany':
                    $relation = new OneToMany($this->db);

                    // Grab values from arguments passed in $db->asOneToMany()
                    $slaveTable = $args[0];
                    $slaveColumnId = $args[1];
                    $alias = $args[2];

                    $rows = $relation->merge($this->getMasterPkName(), $rows, $alias, $slaveTable, $slaveColumnId);
                break;

                case 'asOneToOne':
                    // Grab values from arguments passed in $db->asOneToOne()
                    $column = $args[0];
                    $alias = $args[1];
                    $table = $args[2];
                    $link = $args[3];

                    $relation = new OneToOne($this->db);
                    $rows = $relation->merge($rows, $column, $alias, $table, $link);
                break;

                case 'asManyToMany':
                    // Grab values from arguments passed in $db->asManyToMany()
                    $alias = $args[0];
                    $junction = $args[1];
                    $column = $args[2];
                    $table = $args[3];
                    $pk = $args[4];
                    $columns = $args[5];

                    $relation = new ManyToMany($this->db);
                    $rows = $relation->merge($this->getMasterPkName(), $alias, $rows, $junction, $column, $table, $pk, $columns);
                break;
            }
        }

        $this->clearQueue();
        return $rows;
    }
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;
    }
58486
public function extractBookmarksFromRows(array $rows): array
    {
        $bookmarks = [];
        foreach ($rows as $row) {
            $bookmarks[] = $this->extractBookmarkFromRow($row);
        }

        return $bookmarks;
    }
818924
public function setRows(array $rows)
    {
        $this->rows = $rows;
        $this->setKeys(array_keys($this->rows[0]));
        return $this;
    }
836311
public function setRows($rows = [])
    {
        if (Arr::isAssoc($rows)) {
            foreach ($rows as $key => $item) {
                $this->rows[] = [$key, $item];
            }

            return $this;
        }

        $this->rows = $rows;

        return $this;
    }
558121
protected static function indexByParent($rows)
    {
        $parents = [];

        foreach ($rows as $row) {
            $parents[(int) $row['parent_id']][(int) $row['child_id']] = (int) $row['child_id'];
        }

        return $parents;
    }
271877
public function loadCollectionValues(LoadingContext $context, array $rows) : array
    {
        $primaryKey = $this->primaryKeyColumn->getName();
        $ids        = [];

        foreach ($rows as $key => $row) {
            $ids[$key] = $row->getColumn($primaryKey);
        }

        return $ids;
    }
12932
public function extractTypesFromRows(array $rows, bool $keepTypeIdAsKey = false)
    {
        $types = array();
        $fields = array();

        foreach ($rows as $row) {
            $typeId = (int)$row['ezcontentclass_id'];
            if (!isset($types[$typeId])) {
                $types[$typeId] = $this->extractTypeFromRow($row);
            }

            $fieldId = (int)$row['ezcontentclass_attribute_id'];

            if ($fieldId && !isset($fields[$fieldId])) {
                $fieldDataRows = array_filter($rows, function (array $row) use ($fieldId) {
                    return (int) $row['ezcontentclass_attribute_id'] === (int) $fieldId;
                });

                $multilingualData = $this->extractMultilingualData($fieldDataRows);

                $types[$typeId]->fieldDefinitions[] = $fields[$fieldId] = $this->extractFieldFromRow($row, $multilingualData);
            }

            $groupId = (int)$row['ezcontentclass_classgroup_group_id'];
            if (!in_array($groupId, $types[$typeId]->groupIds)) {
                $types[$typeId]->groupIds[] = $groupId;
            }
        }

        foreach ($types as $type) {
            sort($type->groupIds);
        }

        if ($keepTypeIdAsKey) {
            return $types;
        }

        // Re-index $types to avoid people relying on ID keys
        return array_values($types);
    }
63474
public function getRowAttributes(Row $row, $columns, $resultColumns)
    {
        $attributes = [];

        foreach ($resultColumns as $key => $column)
        {
            $attributes[$columns[$key]] = $row[$column];
        }

        return $attributes;
    }
1192552
public function data($rows=null)
    {
        if ($rows!==null) {
            $this->rows = $rows;
            return $this;
        } else {
            return $this->rows;
        }
    }
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;
    }
30272
private function resolvePermissions(Row $row, UserInterface $user = null)
    {
        $permissions = [];
        if (null !== $user) {
            foreach ($user->getRoleObjects() as $role) {
                foreach (array_filter(explode(' ', $row->getValue(sprintf('role%s', $role->getId())))) as $permission) {
                    $permissions[$role->getId()][$permission] = true;
                }
            }
        }

        return $permissions;
    }