Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 402] [Versions 401 and 403]

(no description)

File Size: 472 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: Cells  - X-Ref

__construct(Worksheet $parent, CacheInterface $cache)   X-Ref
Initialise this new cell collection.

param: Worksheet $parent The worksheet for this cell collection

getParent()   X-Ref
Return the parent worksheet for this cell collection.

return: null|Worksheet

has($cellCoordinate)   X-Ref
Whether the collection holds a cell for the given coordinate.

param: string $cellCoordinate Coordinate of the cell to check

update(Cell $cell)   X-Ref
Add or update a cell in the collection.

param: Cell $cell Cell to update

delete($cellCoordinate)   X-Ref
Delete a cell in cache identified by coordinate.

param: string $cellCoordinate Coordinate of the cell to delete

getCoordinates()   X-Ref
Get a list of all cell coordinates currently held in the collection.

return: string[]

getSortedCoordinates()   X-Ref
Get a sorted list of all cell coordinates currently held in the collection by row and column.

return: string[]

getCurrentCoordinate()   X-Ref
Return the cell coordinate of the currently active cell object.

return: null|string

getCurrentColumn()   X-Ref
Return the column coordinate of the currently active cell object.


getCurrentRow()   X-Ref
Return the row coordinate of the currently active cell object.


getHighestRowAndColumn()   X-Ref
Get highest worksheet column and highest row that have cell records.

return: array Highest column name and highest row number

getHighestColumn($row = null)   X-Ref
Get highest worksheet column.

param: null|int|string $row Return the highest column for the specified row,
return: string Highest column name

getHighestRow($column = null)   X-Ref
Get highest worksheet row.

param: null|string $column Return the highest row for the specified column,
return: int Highest row number

getUniqueID()   X-Ref
Generate a unique ID for cache referencing.

return: string Unique Reference

cloneCellCollection(Worksheet $worksheet)   X-Ref
Clone the cell collection.

return: self

removeRow($row)   X-Ref
Remove a row, deleting all cells in that row.

param: int|string $row Row number to remove

removeColumn($column)   X-Ref
Remove a column, deleting all cells in that column.

param: string $column Column ID to remove

storeCurrentCell()   X-Ref
Store cell data in cache for the current cell object if it's "dirty",
and the 'nullify' the current cell object.


destructIfNeeded(self $cells, string $message)   X-Ref
No description

add($cellCoordinate, Cell $cell)   X-Ref
Add or update a cell identified by its coordinate into the collection.

param: string $cellCoordinate Coordinate of the cell to update
param: Cell $cell Cell to update
return: Cell

get($cellCoordinate)   X-Ref
Get cell at a specific coordinate.

param: string $cellCoordinate Coordinate of the cell
return: null|Cell Cell that was found, or null if not found

unsetWorksheetCells()   X-Ref
Clear the cell collection and disconnect from our parent.


__destruct()   X-Ref
Destroy this cell collection.


getAllCacheKeys()   X-Ref
Returns all known cache keys.

return: Generator|string[]