Class \avadim\FastExcelTemplator\RowTemplateCollection

Source: 3.4.0 · 4de0b13

On this page

  • __construct() – RowTemplateCollection constructor
  • addRowTemplate() – Add row template to collection
  • cloneCell() – Clone cell in all row templates of the collection
  • current() – Return the current element
  • delRowTemplate() – Delete row template from collection
  • key() – Return the key of the current element
  • next() – Move forward with wrap-around for compatibility; insertRow() uses the independent nextTemplate() cycle.
  • nextTemplate() – Select the next insertion template independently of foreach/next()/rewind(); insertRow() shares this cycle and copies the selected template, while add/delete restarts it.
  • rewind() – Rewind the Iterator to the first element
  • setSheet() – Set sheet template
  • valid() – Checks if current position is valid

__construct()


php
public function __construct(?array $rowData = [], 
                            ?SheetTemplate $sheet = null)

RowTemplateCollection constructor

Parameters

  • array|null $rowData
  • SheetTemplate|null $sheet – Sheet the templates were captured from; some operations (cloneCell) need it, it can also be set later by setSheet()

addRowTemplate()


php
public function addRowTemplate($row, ?int $rowNum = 0): void

Add row template to collection

Parameters

  • RowTemplate $row
  • int|null $rowNum

cloneCell()


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

Clone cell in all row templates of the collection

Parameters

  • string $colSource
  • string|array $colTarget
  • bool|null $checkMerge

current()


php
public function current(): mixed

Return the current element

Parameters

None


delRowTemplate()


php
public function delRowTemplate(int $rowNum): void

Delete row template from collection

Parameters

  • int $rowNum

key()


php
public function key(): mixed

Return the key of the current element

Parameters

None


next()


php
public function next(): mixed

Move forward with wrap-around for compatibility; insertRow() uses the independent nextTemplate() cycle.

Parameters

None


nextTemplate()


php
public function nextTemplate(): RowTemplate

Select the next insertion template independently of foreach/next()/rewind(); insertRow() shares this cycle and copies the selected template, while add/delete restarts it.

Parameters

None


rewind()


php
public function rewind(): mixed

Rewind the Iterator to the first element

Parameters

None


setSheet()


php
public function setSheet($sheet)

Set sheet template

Parameters

  • SheetTemplate $sheet

valid()


php
public function valid(): bool

Checks if current position is validSince next() deliberately wraps around, the position alone can never end a foreach.The counter reset by rewind() is what makes a foreach walk the collection exactly once.

Parameters

None


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.