Merges with main result-set

@param array $rows
@param string $column Column name from the master table to be removed
@param string $alias Virtual column name to be appeared instead of removed one
@param string Slave table name
@return array
500482
public function merge(array $rows, $column, $alias, $table, $link)
    {
        foreach ($rows as &$row) {
            if (isset($row[$column])) {
                $value = $row[$column];

                $set = $this->querySlaveTable($table, $link, $value);
                $set = $this->getPreparedSet($set, $link);

                $row[$alias] = $set;
                unset($row[$column]);
            }
        }

        return $rows;
    }
1066940
public function flatten($column) {
        $out = array();
        foreach ($this as $row) {
            $out[] = $row->flatten($column);
        }
        return $out;
    }
164798
protected function buildColumnsGroup(string $alias, array $columns): string
    {
        $parts = [];
        foreach ($columns as $column) {
            $parts[] = $column instanceof Query\Aggregation
                ? $column->setTableAlias($alias)
                : $alias . '.' . $column;
        }

        return implode(', ', $parts);
    }
652761
public function addMax($column, string $alias = null): self
    {
        return $this->addAggregate('MAX', $column, $alias);
    }
1062104
public function table($table, $alias = null)
    {
        $this->sqlParts['from']['table'] = $table;

        if ($alias) {
            $this->sqlParts['from']['alias'] = $alias;
        }

        return $this;
    }
338282
public function selectMin(string $column, string $alias = null)
    {
        $instance = $this->selectQueryInstance();

        $instance->selectQuery()->min($column, $alias);

        return $instance;
    }
583257
public function max(string $column, string $alias = null)
    {
        $this->columnRaw($this->dialect()->max($column, $alias));

        return $this;
    }
472271
public function pluck($column, $key = null)
    {
        $results = $this->get(is_null($key) ? [$column] : [$column, $key]);
        // If the columns are qualified with a table or have an alias, we cannot use
        // those directly in the "pluck" operations since the results from the DB
        // are only keyed by the column itself. We'll strip the table out here.
        return array_pluck($results, $this->stripTableForPluck($column), $this->stripTableForPluck($key));
    }
1138389
private function copyRow($rows, $line)
    {
        $row = $rows[$line];
        foreach ($row as $cellKey => $cellValue) {
            $row[$cellKey] = '';
            if ($cellValue instanceof TableCell) {
                $row[$cellKey] = new TableCell('', array('colspan' => $cellValue->getColspan()));
            }
        }

        return $row;
    }
890460
public function withPivot($table, array $columns = ['*'], $class = Pivot::class, $accessor = null)
    {
        if ($columns === ['*']) {
            $columns = $this->query->getConnection()->getSchemaBuilder()->getColumnListing($table);
        }

        $accessor = $accessor ?: $table;

        if (isset($this->intermediateTables[$accessor])) {
            $columns = array_merge($columns, $this->intermediateTables[$accessor]['columns']);
        }

        $this->intermediateTables[$accessor] = compact('table', 'columns', 'class');

        return $this;
    }
687714
public function getRow($index = 0, $column = null)
    {
        if (is_string($index)) {
            $column = $index;
            $index = 0;
        }

        $rows = $this->getRows();

        if (!is_null($column) && isset($rows[$index][$column])) {
            return $rows[$index][$column];
        } else if (is_null($column) && isset($rows[$index])) {
            return $rows[$index];
        }

        return null;
    }
387795
public function remove($row, $column)
    {
        if (isset($this->_layout[$row][$column])) {
            unset($this->_layout[$row][$column]);
        }

        return $this;
    }
1248500
public function avg(string $column, string $alias = null)
    {
        $this->columnRaw($this->dialect()->avg($column, $alias));

        return $this;
    }
712564
public function selectCount(string $column = '*', string $alias = null): string
    {
        return 'SELECT ' . $this->count($column, $alias);
    }
703470
public function addColumnContent($row, $column, $termId)
    {
        if (isset($this->fields[$column]) && $field = $this->fields[$column]) {
            echo $field->outputColumnContent();
        } else {
            return $row;
        }
    }
1162153
public function rowsFrom(string $table, string ...$tables)
    {
        $instance = $this->deleteQueryInstance();

        $instance->deleteQuery()->rowsFrom($table, ...$tables);

        return $instance;
    }
1165167
public function selectColumn(string $column, ?string $alias = null)
    {
        $instance = $this->selectQueryInstance();

        $instance->selectQuery()->column($column, $alias);

        return $instance;
    }