Class \avadim\FastExcelTemplator\RowTemplate

Source: 3.4.0 · 4de0b13

On this page


__construct()


php
public function __construct(?array $cellData = [])

RowTemplate constructor

Parameters

  • array|null $cellData

addCell()


php
public function addCell(string $colLetter, $value, $style): RowTemplate

Add a cell to the row

Parameters

  • string $colLetter
  • mixed $value
  • mixed|null $style

Examples

php
$row->addCell('G', $value);

appendCell()


php
public function appendCell(?string $colSource = null, 
                           ?int $number = null): RowTemplate

Append a source cell to the end of the row

Parameters

  • string|null $colSource
  • int|null $number

Examples

php
$row->appendCell('E'); // Append cell like E to the end of the row
$row->appendCell('E', 2); // Append two cells like E to the end of the row

attribute()


php
public function attribute($name): ?string

Source row attribute

Parameters

  • string $name

cells()


php
public function cells(): array

Get all cells of the row

Parameters

None


cloneCell()


php
public function cloneCell(string $colSource, $colTarget, 
                          ?bool $checkMerge = false): RowTemplate

Clone a cell

Parameters

  • string $colSource
  • string|string[] $colTarget
  • bool|null $checkMerge

current()


php
public function current(): mixed

Return the current element

Parameters

None


getAttributes()


php
public function getAttributes(): array

All source row attributes

Parameters

None


getSheetTemplate()


php
public function getSheetTemplate(): ?SheetTemplate

Get sheet template

Parameters

None


getValue()


php
public function getValue(string $colLetter): mixed|null

Returns value of cell

Parameters

  • string $colLetter

getValues()


php
public function getValues(): array

Get values of all cells of the row

Parameters

None


key()


php
public function key(): mixed

Return the key of the current element

Parameters

None


next()


php
public function next(): void

Move forward to next element

Parameters

None


removeCell()


php
public function removeCell(string $col): RowTemplate

Mark a cell for row-local removal and left-shifting during transfer; unknown columns are ignored, horizontal merges shrink and affected multi-row merges are rejected.

Parameters

  • string $col

Examples

php
$row->removeCell('G');

removeCells()


php
public function removeCells(array $cols): RowTemplate

Mark cells for row-local removal and left-shifting during transfer, using removeCell() semantics; references in other cells are not rewritten.

Parameters

  • string[] $cols

Examples

php
$row->removeCells(['G', 'H']);

rewind()


php
public function rewind(): void

Rewind the Iterator to the first element

Parameters

None


rowHeight()


php
public function rowHeight(): ?string

Source row height

Parameters

None


rowNumber()


php
public function rowNumber(): ?int

Source row number

Parameters

None


setAttributes()


php
public function setAttributes(array $attributes): RowTemplate

Set row attributes

Parameters

  • array $attributes

setCellStyle()


php
public function setCellStyle(string $colLetter, $style): RowTemplate

Set cell style

Parameters

  • string $colLetter
  • mixed $style

setRowStyle()


php
public function setRowStyle($style): RowTemplate

Set row style

Parameters

  • mixed $style

setSheetTemplate()


php
public function setSheetTemplate(avadim\FastExcelTemplator\SheetTemplate $sheetTemplate): RowTemplate

Set sheet template

Parameters

  • SheetTemplate $sheetTemplate

setValue()


php
public function setValue(string $colLetter, $value): RowTemplate

Set cell value; null clears content and the old formula while retaining formatting

Parameters

  • string $colLetter – Column letter, case-insensitive
  • mixed $value – Scalar or null; a string starting with '=' is a formula

Examples

php
$row->setValue('G', '=SUM(A1:A10)');

setValues()


php
public function setValues(array $values): RowTemplate

Set multiple cell values

Parameters

  • array $values

Examples

php
$row->setValues(['G' => '=SUM(A1:A10)', 'H' => 'value']);

valid()


php
public function valid(): bool

Checks if current position is valid

Parameters

None


withValue()


php
public function withValue($value): RowTemplate

Assign a value to the last added cell

Parameters

  • mixed $value

Examples

php
$row->appendCell('E')->withValue('value');

withValues()


php
public function withValues(array $values): RowTemplate

Assign values to the last added cells

Parameters

  • array $values

Examples

php
$row->appendCell('E', 2)->withValues(['value1', 'value2']);

FastExcelTemplator 3.4.0 · Search this library and version.

Loading search…

Could not load search. Please try again.

No results. Try another word or method name.