Write the start of the sheet we will be adding data to.

@param array $columns
484830
public function start_sheet($columns) {
        echo "<table border=1 cellspacing=0 cellpadding=3>";
        echo \html_writer::start_tag('tr');
        foreach ($columns as $k => $v) {
            echo \html_writer::tag('th', $v);
        }
        echo \html_writer::end_tag('tr');
    }
997714
public function prev()
    {
        if ($this->position <= $this->startColumn) {
            throw new PHPExcel_Exception(
                "Column is already at the beginning of range (" .
                PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . " - " .
                PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . ")"
            );
        }

        --$this->position;
    }
653329
public function columns($columns)
    {
        if (!is_array($columns)) {
            $columns = preg_split('~\s*,\s*~', trim($columns));
        }

        $this->columns = $columns;

        return $this;
    }
592243
public function setColumns(array $indexColumns)
    {
        $this->indexColumns = array();
        $this->indexColumnSizes = array();
        foreach ($indexColumns as $col) {
            $this->addColumn($col);
        }
    }
1038603
protected function write($messages): void
    {
        if (! \is_array($messages)) {
            $messages = [$messages];
        }

        foreach ($messages as $i => $message) {
            $messages[$i] = '    - ' . $message;
        }

        $this->io->writeError($messages, true, IOInterface::VERBOSE);
    }
235770
protected function persist($columns)
    {
        $this->db->beginTransaction();

        try {
            $createdUser = $this->model->create($columns);
        } catch (Exception $e) {
            $this->db->rollBack();
            $this->warn('Could not persist to the database: ' . $e->getMessage());
        }

        $this->db->commit();
        $this->info('User persisted');
        dump($createdUser);
    }
594845
public function write(array $data): void
    {
        $this->doWrite($data, $this->file, $this->sheet, $this->range);
    }
682841
public function addColumn($columns)
    {
        unset($columns['date']);

        foreach ($this->data as $id => $field) {
            if (isset($field->show_admin_column) && $field->show_admin_column) {
                $columns[$id] = $field->label;
            }
        }

        $columns['date'] = __('Date');

        return $columns;
    }
1196571
public function addRows(array $rows): void
    {
        if (empty($rows)) {
            throw new DatabaseException('Can not perform insert with empty rows.');
        }

        // Collect column names and add to statement:
        $cols = array_keys(reset($rows));
        foreach ($cols as $i => $col) {
            $cols[$i] = $this->quoteName($col);
        }
        $pattern = " (%s) VALUES" . PHP_EOL;
        $this->statement .= sprintf($pattern, implode(',', $cols));

        // Add values for each row to insert statement:
        $rowValues = [];
        foreach ($rows as $row) {
            $placeholders = $this->bindRowValues($row);
            array_push($rowValues, sprintf('(%s)', implode(',', $placeholders)));
        }
        $this->statement .= implode(',', $rowValues);
    }
741519
protected function _first($columns = '*')
    {
        $data = $this->db->get($this->table, $columns, $this->where);

        if (empty($data)) {
            return false;
        }

        return $this->setProperties($data);
    }
427912
public function addColumn($column) {
        $columns = $this->getColumns();
        $columns[] = $column;
        $this->setColumns($columns);
    }
655863
public function on($columnNames)
    {
        if (!is_array($columnNames)) {
            $columnNames = [(string)$columnNames];
        }

        call_user_func($this->callback, $columnNames);
    }
99258
protected function startSheet()
    {
        $this->sheetFilePointer = fopen($this->worksheetFilePath, 'w');
        $this->throwIfSheetFilePointerIsNotAvailable();

        fwrite($this->sheetFilePointer, self::SHEET_XML_FILE_HEADER);
        fwrite($this->sheetFilePointer, '<sheetData>');
    }
20375
public function add( $data )
	{
		$columnNum = 0;
		$rowNum = $this->_iterator->current()->getRowIndex();

		foreach( (array) $data as $value ) {
			$this->_sheet->setCellValueByColumnAndRow( $columnNum++, $rowNum, $value );
		}

		$this->_iterator->next();
	}
983156
public function write(
        array $data,
        string $sheet = ClientInterface::DEFAULT_SHEET,
        string $range = ClientInterface::DEFAULT_RANGE
    ): void {
        $this->doWrite($data, $this->file, $sheet, $range);
    }
604425
protected function registerColumns()
    {
        $this->hook->action('admin_init', function () {
            $this->getSingularity()->columns($this->columns());
        })->dispatch();
    }
6602
protected void writeRow(final String... columns) throws IOException {
		
		if( columns == null ) {
			throw new NullPointerException(String.format("columns to write should not be null on line %d", lineNumber));
		} else if( columns.length == 0 ) {
			throw new IllegalArgumentException(String.format("columns to write should not be empty on line %d",
				lineNumber));
		}
		
		StringBuilder builder = new StringBuilder();
		for( int i = 0; i < columns.length; i++ ) {
			
			columnNumber = i + 1; // column no used by CsvEncoder
			
			if( i > 0 ) {
				builder.append((char) preference.getDelimiterChar()); // delimiter
			}
			
			final String csvElement = columns[i];
			if( csvElement != null ) {
				final CsvContext context = new CsvContext(lineNumber, rowNumber, columnNumber);
				final String escapedCsv = encoder.encode(csvElement, context, preference);
				builder.append(escapedCsv);
				lineNumber = context.getLineNumber(); // line number can increment when encoding multi-line columns
			}
			
		}
		
		builder.append(preference.getEndOfLineSymbols()); // EOL
		writer.write(builder.toString());
	}