Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250620) (7d9030acd6e)
|
Public Member Functions | |
__construct () | |
Create a new Xlsx Reader instance. | |
canRead (string $filename) | |
Can the current IReader read the file? | |
getIgnoreRowsWithNoCells () | |
getIncludeCharts () | |
Read charts in workbook? | |
getLoadSheetsOnly () | |
Get which sheets to load Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null indicating that all worksheets in the workbook should be loaded. | |
getReadDataOnly () | |
Read data only? | |
getReadEmptyCells () | |
Read empty cells? | |
getReadFilter () | |
Read filter. | |
getSecurityScanner () | |
getSecurityScannerOrThrow () | |
getValueBinder () | |
listWorksheetInfo (string $filename) | |
Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns). | |
listWorksheetNames (string $filename) | |
Reads names of the worksheets from a file, without parsing the whole file to a Spreadsheet object. | |
load (string $filename, int $flags=0) | |
Loads Spreadsheet from file. | |
setIgnoreRowsWithNoCells (bool $ignoreRowsWithNoCells) | |
setIncludeCharts (bool $includeCharts) | |
Set read charts in workbook Set to true, to advise the Reader to include any charts that exist in the workbook. | |
setLoadAllSheets () | |
Set all sheets to load Tells the Reader to load all worksheets from the workbook. | |
setLoadSheetsOnly (string|array|null $sheetList) | |
Set which sheets to load. | |
setReadDataOnly (bool $readCellValuesOnly) | |
Set read data only Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting or structural information (like merges). | |
setReadEmptyCells (bool $readEmptyCells) | |
Set read empty cells Set to true (the default) to advise the Reader read data values for all cells, irrespective of value. | |
setReadFilter (IReadFilter $readFilter) | |
Set read filter. | |
setValueBinder (?IValueBinder $valueBinder) | |
Public Attributes | |
const | IGNORE_EMPTY_CELLS = 4 |
Flag used to ignore empty cells when reading. | |
const | IGNORE_ROWS_WITH_NO_CELLS = 8 |
Flag used to ignore rows without cells. | |
const | INITIAL_FILE = '_rels/.rels' |
const | LOAD_WITH_CHARTS = 1 |
const | READ_DATA_ONLY = 2 |
Flag used to read data only, not style or structure information. | |
Protected Member Functions | |
loadSpreadsheetFromFile (string $filename) | |
Loads Spreadsheet from file. | |
openFile (string $filename) | |
Open file for reading. | |
processFlags (int $flags) | |
Protected Attributes | |
resource | $fileHandle |
bool | $ignoreRowsWithNoCells = false |
Ignore rows with no cells? | |
bool | $includeCharts = false |
Read charts that are defined in the workbook? | |
null string[] array | $loadSheetsOnly = null |
Restrict which sheets should be loaded? | |
bool | $readDataOnly = false |
bool | $readEmptyCells = true |
Read empty cells? | |
IReadFilter | $readFilter |
IReadFilter instance. | |
XmlScanner | $securityScanner = null |
IValueBinder | $valueBinder = null |
PhpOffice\PhpSpreadsheet\Reader\Xlsx::__construct | ( | ) |
Create a new Xlsx Reader instance.
Reimplemented from PhpOffice\PhpSpreadsheet\Reader\BaseReader.
PhpOffice\PhpSpreadsheet\Reader\Xlsx::canRead | ( | string | $filename | ) |
Can the current IReader read the file?
Implements PhpOffice\PhpSpreadsheet\Reader\IReader.
|
inherited |
Read charts in workbook?
If this is true, then the Reader will include any charts that exist in the workbook. Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. If false (the default) it will ignore any charts defined in the workbook file.
Implements PhpOffice\PhpSpreadsheet\Reader\IReader.
|
inherited |
Get which sheets to load Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null indicating that all worksheets in the workbook should be loaded.
Implements PhpOffice\PhpSpreadsheet\Reader\IReader.
|
inherited |
Read data only?
If this is true, then the Reader will only read data values for cells, it will not read any formatting or structural information (like merges). If false (the default) it will read data and formatting.
Implements PhpOffice\PhpSpreadsheet\Reader\IReader.
|
inherited |
Read empty cells?
If this is true (the default), then the Reader will read data values for all cells, irrespective of value. If false it will not read data for cells containing a null value or an empty string.
Implements PhpOffice\PhpSpreadsheet\Reader\IReader.
|
inherited |
Read filter.
Implements PhpOffice\PhpSpreadsheet\Reader\IReader.
PhpOffice\PhpSpreadsheet\Reader\Xlsx::listWorksheetInfo | ( | string | $filename | ) |
Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
Reimplemented from PhpOffice\PhpSpreadsheet\Reader\BaseReader.
PhpOffice\PhpSpreadsheet\Reader\Xlsx::listWorksheetNames | ( | string | $filename | ) |
Reads names of the worksheets from a file, without parsing the whole file to a Spreadsheet object.
Reimplemented from PhpOffice\PhpSpreadsheet\Reader\BaseReader.
|
inherited |
Loads Spreadsheet from file.
int | $flags | the optional second parameter flags may be used to identify specific elements that should be loaded, but which won't be loaded by default, using these values: IReader::LOAD_WITH_CHARTS - Include any charts that are defined in the loaded file |
Implements PhpOffice\PhpSpreadsheet\Reader\IReader.
|
protected |
Loads Spreadsheet from file.
Reimplemented from PhpOffice\PhpSpreadsheet\Reader\BaseReader.
|
inherited |
Set read charts in workbook Set to true, to advise the Reader to include any charts that exist in the workbook.
Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. Set to false (the default) to discard charts.
$this |
Implements PhpOffice\PhpSpreadsheet\Reader\IReader.
|
inherited |
Set all sheets to load Tells the Reader to load all worksheets from the workbook.
$this |
Implements PhpOffice\PhpSpreadsheet\Reader\IReader.
|
inherited |
Set which sheets to load.
null | array | string | $value | This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name. If NULL, then it tells the Reader to read all worksheets in the workbook |
$this |
Implements PhpOffice\PhpSpreadsheet\Reader\IReader.
|
inherited |
Set read data only Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting or structural information (like merges).
Set to false (the default) to advise the Reader to read both data and formatting for cells.
$this |
Implements PhpOffice\PhpSpreadsheet\Reader\IReader.
|
inherited |
Set read empty cells Set to true (the default) to advise the Reader read data values for all cells, irrespective of value.
Set to false to advise the Reader to ignore cells containing a null value or an empty string.
$this |
Implements PhpOffice\PhpSpreadsheet\Reader\IReader.
|
inherited |
|
protectedinherited |
Ignore rows with no cells?
Identifies whether the Reader should ignore rows with no cells. Currently implemented only for Xlsx.
|
protectedinherited |
Read charts that are defined in the workbook?
Identifies whether the Reader should read the definitions for any charts that exist in the workbook;.
|
protectedinherited |
Restrict which sheets should be loaded?
This property holds an array of worksheet names to be loaded. If null, then all worksheets will be loaded. This property is ignored for Csv, Html, and Slk.
|
protectedinherited |
Read empty cells?
Identifies whether the Reader should read data values for all cells, or should ignore cells containing null value or empty string.
|
inherited |
Flag used to ignore empty cells when reading.
The ignored cells will not be instantiated.
|
inherited |
Flag used to ignore rows without cells.
This flag is supported only for some formats. This can heavily improve performance for some files.