|
Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
|
Static Public Member Functions | |
| static | absoluteCoordinate (string $cellAddress) |
| Make string coordinate absolute. | |
| static | absoluteReference (int|string $cellAddress) |
| Make string row, column or cell coordinate absolute. | |
| static | buildRange (array $range) |
| Build range from coordinate strings. | |
| static | columnIndexFromString (?string $columnAddress) |
| Column index from string. | |
| static | coordinateFromString (string $cellAddress) |
| Convert string coordinate to [0 => int column index, 1 => int row index]. | |
| static | coordinateIsInsideRange (string $range, string $coordinate) |
| Check if coordinate is inside a range. | |
| static | coordinateIsRange (string $cellAddress) |
| Checks if a Cell Address represents a range of cells. | |
| static | extractAllCellReferencesInRange (string $cellRange) |
| Extract all cell references in range, which may be comprised of multiple cell ranges. | |
| static | getRangeBoundaries (string $range) |
| Calculate range boundaries. | |
| static | indexesFromString (string $coordinates) |
| Convert string coordinate to [0 => int column index, 1 => int row index, 2 => string column string]. | |
| static | mergeRangesInCollection (array $coordinateCollection) |
| Convert an associative array of single cell coordinates to values to an associative array of cell ranges to values. | |
| static | rangeBoundaries (string $range) |
| Calculate range boundaries. | |
| static | rangeDimension (string $range) |
| Calculate range dimension. | |
| static | resolveUnionAndIntersection (string $cellBlock, string $implodeCharacter=',') |
| Get all cell references applying union and intersection. | |
| static | splitRange (string $range) |
| Split range into coordinate strings. | |
| static | stringFromColumnIndex (int|string $columnIndex) |
| String from column index. | |
|
static |
Make string coordinate absolute.
| string | $cellAddress | e.g. 'A1' |
| string | Absolute coordinate e.g. '$A$1' |
|
static |
Make string row, column or cell coordinate absolute.
| int | string | $cellAddress | e.g. 'A' or '1' or 'A1' Note that this value can be a row or column reference as well as a cell reference |
| string | Absolute coordinate e.g. '$A' or '$1' or '$A$1' |
|
static |
Build range from coordinate strings.
| array | $range | Array containing one or more arrays containing one or two coordinate strings |
| string | String representation of $pRange |
|
static |
Column index from string.
| ?string | $columnAddress | eg 'A' |
| int | Column index (A = 1) |
|
static |
Convert string coordinate to [0 => int column index, 1 => int row index].
| string | $cellAddress | eg: 'A1' |
| array{0 | string, 1: string} Array containing column and row (indexes 0 and 1) |
|
static |
Check if coordinate is inside a range.
| string | $range | Cell range, Single Cell, Row/Column Range (e.g. A1:A1, B2, B:C, 2:3) |
| string | $coordinate | Cell coordinate (e.g. A1) |
| bool | true if coordinate is inside range |
|
static |
Checks if a Cell Address represents a range of cells.
| string | $cellAddress | eg: 'A1' or 'A1:A2' or 'A1:A2,C1:C2' |
| bool | Whether the coordinate represents a range of cells |
|
static |
Extract all cell references in range, which may be comprised of multiple cell ranges.
| string | $cellRange | Range: e.g. 'A1' or 'A1:C10' or 'A1:E10,A20:E25' or 'A1:E5 C3:G7' or 'A1:C1,A3:C3 B1:C3' |
| array | Array containing single cell references |
|
static |
Calculate range boundaries.
| string | $range | Cell range, Single Cell, Row/Column Range (e.g. A1:A1, B2, B:C, 2:3) |
| array | Range coordinates [Start Cell, End Cell] where Start Cell and End Cell are arrays [Column ID, Row Number] |
|
static |
Convert string coordinate to [0 => int column index, 1 => int row index, 2 => string column string].
| string | $coordinates | eg: 'A1', '$B$12' |
| array{0 | int, 1: int, 2: string} Array containing column and row index, and column string |
|
static |
Convert an associative array of single cell coordinates to values to an associative array of cell ranges to values.
Only adjacent cell coordinates with the same value will be merged. If the value is an object, it must implement the method getHashCode().
For example, this function converts:
[ 'A1' => 'x', 'A2' => 'x', 'A3' => 'x', 'A4' => 'y' ]
to:
[ 'A1:A3' => 'x', 'A4' => 'y' ]
| array | $coordinateCollection | associative array mapping coordinates to values |
| array | associative array mapping coordinate ranges to valuea |
|
static |
Calculate range boundaries.
| string | $range | Cell range, Single Cell, Row/Column Range (e.g. A1:A1, B2, B:C, 2:3) |
| array | Range coordinates [Start Cell, End Cell] where Start Cell and End Cell are arrays (Column Number, Row Number) |
|
static |
Calculate range dimension.
| string | $range | Cell range, Single Cell, Row/Column Range (e.g. A1:A1, B2, B:C, 2:3) |
| array | Range dimension (width, height) |
|
static |
Get all cell references applying union and intersection.
| string | $cellBlock | A cell range e.g. A1:B5,D1:E5 B2:C4 |
| string | A string without intersection operator. If there was no intersection to begin with, return original argument. Otherwise, return cells and/or cell ranges in that range separated by comma. |
|
static |
Split range into coordinate strings.
| string | $range | e.g. 'B4:D9' or 'B4:D9,H2:O11' or 'B4' |
| array | Array containing one or more arrays containing one or two coordinate strings e.g. ['B4','D9'] or [['B4','D9'], ['H2','O11']] or ['B4'] |
|
static |
String from column index.
| int | numeric-string | $columnIndex | Column index (A = 1) |