Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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

(no description)

File Size: 499 lines (13 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.

return: bool
param: string $cellCoordinate Coordinate of the cell to check

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

return: Cell
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[]

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

return: array Highest column name and highest row number

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.

return: string

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

return: int

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

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

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

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

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: 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(bool $stored, 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.

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

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

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

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[]