Fills the query result rows with the snippets built from source determined by
[[snippetCallback]] result.
@param array $rows raw query result rows.
@return array|ActiveRecord[] query result rows with filled up snippets.
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;
    }
58486
public function extractBookmarksFromRows(array $rows): array
    {
        $bookmarks = [];
        foreach ($rows as $row) {
            $bookmarks[] = $this->extractBookmarkFromRow($row);
        }

        return $bookmarks;
    }
855802
public static function fetch($tables)
    {
        foreach ($tables as $table) {
            $result = Driver::query("SELECT * FROM $table", Driver::INDEX);
            $fields = $result->columnCount();
            $rows = $result->rowCount();
            $data = Driver::read("SELECT * FROM $table", Driver::INDEX);
            //
            $content = (!isset($content) ? '' : $content).self::stucture($table);
            //

            $st_counter = 0;
            foreach ($data as $row) {
                if ($st_counter % 100 == 0 || $st_counter == 0) {
                    $content .= "\n-- Table Data\nINSERT INTO ".$table.' VALUES';
                }
                //
                $content .= "\n(";
                //
                for ($j = 0; $j < $fields; $j++) {
                    $row[$j] = str_replace("\n", '\\n', addslashes($row[$j]));
                    //
                    if (isset($row[$j])) {
                        if (!empty($row[$j])) {
                            $content .= '"'.$row[$j].'"';
                        } else {
                            $content .= 'NULL';
                        }
                    }
                    //
                    else {
                        $content .= '""';
                    }
                    //
                    if ($j < ($fields - 1)) {
                        $content .= ',';
                    }
                }
                //
                $content .= ')';
                //
                if ((($st_counter + 1) % 100 == 0 && $st_counter != 0) || $st_counter + 1 == $rows) {
                    $content .= ';';
                }
                //
                else {
                    $content .= ',';
                }
                //
                $st_counter = $st_counter + 1;
            }

            $content .= "\n\n\n";
        }

        return $content;
    }
833014
private function extractValues(array $rows)
    {
        $result = array();

        foreach ($rows as $row) {
            foreach ($row as $column => $value) {
                array_push($result, $value);
            }
        }

        return $result;
    }
70693
public static function createFromArray(array $rows)
    {
        $logs = [];

        foreach ($rows as $row) {
            $logs[] = TaskLogEntity::createFromArray($row);
        }

        return new static($logs);
    }
198541
public static function fromRowArray(Table $table, array $rows) : RowSet
    {
        $self = new self($table);

        foreach ($rows as $row) {
            $self->rows[] = $self->createRow($row);
        }

        return $self;
    }
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);
    }
1146086
public function addRow(array $row)
    {
        if (is_array($this->fields)) {
            $assoc = $row;
            $row = [];
            foreach ($this->fields as $field) {
                $row[] = isset($assoc[$field]) ? $assoc[$field] : "";
            }
        }

        $this->data[] = $row;

        return $this;
    }
482086
public function addRows($rows)
    {
        foreach ($rows as $row) {
            $this->inputRows[] = $row;
            $inferredRow = $this->inferRow($row);
            foreach ($this->getFieldNames() as $fieldName) {
                /** @var BaseField $inferredField */
                $inferredField = $inferredRow[$fieldName];
                $inferredFieldType = $inferredField->getInferIdentifier($this->lenient);
                if (!array_key_exists($fieldName, $this->fieldsPopularity)) {
                    $this->fieldsPopularity[$fieldName] = [];
                    $this->fieldsPopularityObjects[$fieldName] = [];
                }
                if (!array_key_exists($inferredFieldType, $this->fieldsPopularity[$fieldName])) {
                    $this->fieldsPopularity[$fieldName][$inferredFieldType] = 0;
                    $this->fieldsPopularityObjects[$fieldName][$inferredFieldType] = $inferredField;
                }
                ++$this->fieldsPopularity[$fieldName][$inferredFieldType];
                arsort($this->fieldsPopularity[$fieldName]);
            }
        }
    }
1273011
public function rowsFromRaw($data)
	{
		$rows = new Rows;

		if ($data && count($data) > 0)
		{
			foreach ($data as $row)
			{
				$rows->push(self::newFromResults($row));
			}
		}

		return $rows;
	}
1131771
public function replaceRows(array $rows): array
    {
        if (null === $this->data) {
            $this->buildIndex();
        }

        $list = [];
        foreach ($rows as $key => $row) {
            if (strpos($key, '@@')) {
                $key = $this->getNewKey();
            }
            $this->data[$key] = $list[$key] = $row;
        }

        if ($list) {
            $this->save();
        }

        return $list;
    }
463443
public function addRows(array $rows, array $classes = array() ){
    $table_row = new TableRow($rows, $classes);
    $this->rows[] = $table_row;

    $this->updateMaxRowLength($table_row);
   }
1067308
function addRows($rows)
	{
		for($i=0; $i < count($rows); $i++) $this->addRow($rows[$i]);
	}
1054529
public function createRows(array $rows): array
    {
        if (null === $this->data) {
            $this->buildIndex();
        }

        $list = [];
        foreach ($rows as $key => $row) {
            $key = $this->getNewKey();
            $this->data[$key] = $list[$key] = $row;
        }

        if ($list) {
            $this->save();
        }

        return $list;
    }
1364683
private function calculateColumnWidths(array $rows) {
        $widths = [];

        foreach ($rows as $row) {
            if ($row['type'] !== '@row') {
                continue;
            }

            foreach ($row['cols'] as $colIndex => $col) {
                $currentWidth = array_get($widths, $colIndex, 0);
                $col = $this->output->format($col, OutputFormat::PLAIN);
                $width = strlen($col);

                if ($width > $currentWidth) {
                    $widths[$colIndex] = $width;
                }
            }
        }

        return $widths;
    }
992157
protected function getColumns( $rows ) {

        $columns = array();

        foreach ( $rows as $row ) {

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

                $columns[ $column ] = true;

            }

        }

        return array_keys( $columns );

    }
3321
public function setRows($rows = []) {

        if (!empty($this->cols)) {
            if (count($rows[0]) < 1) {
                throw new \Exception('Expected 2 dimensional array for rows');
            } elseif (count($this->cols) != 0 && count($this->cols) != count($rows[0])) {
                throw new \Exception('No of cols must equivelent to no heads in rows');
            }
        }
        $this->rows = $rows;
        return $this;
    }