ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PhpOffice\PhpSpreadsheet\Reader\BaseReader Class Reference
+ Inheritance diagram for PhpOffice\PhpSpreadsheet\Reader\BaseReader:
+ Collaboration diagram for PhpOffice\PhpSpreadsheet\Reader\BaseReader:

Public Member Functions

 __construct ()
 IReader constructor. More...
 
 getReadDataOnly ()
 Read data only? If this is true, then the Reader will only read data values for cells, it will not read any formatting information. More...
 
 setReadDataOnly ($pValue)
 Set read data only Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information. More...
 
 getReadEmptyCells ()
 Read empty cells? If this is true (the default), then the Reader will read data values for all cells, irrespective of value. More...
 
 setReadEmptyCells ($pValue)
 Set read empty cells Set to true (the default) to advise the Reader read data values for all cells, irrespective of value. More...
 
 getIncludeCharts ()
 Read charts in workbook? If this is true, then the Reader will include any charts that exist in the workbook. More...
 
 setIncludeCharts ($pValue)
 Set read charts in workbook Set to true, to advise the Reader to include any charts that exist in the workbook. More...
 
 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. More...
 
 setLoadSheetsOnly ($value)
 Set which sheets to load. More...
 
 setLoadAllSheets ()
 Set all sheets to load Tells the Reader to load all worksheets from the workbook. More...
 
 getReadFilter ()
 Read filter. More...
 
 setReadFilter (IReadFilter $pValue)
 Set read filter. More...
 
 getSecurityScanner ()
 
- Public Member Functions inherited from PhpOffice\PhpSpreadsheet\Reader\IReader
 canRead ($pFilename)
 Can the current IReader read the file? More...
 
 load ($pFilename)
 Loads PhpSpreadsheet from file. More...
 

Protected Member Functions

 openFile ($pFilename)
 Open file for reading. More...
 

Protected Attributes

 $readDataOnly = false
 
 $readEmptyCells = true
 
 $includeCharts = false
 
 $loadSheetsOnly
 
 $readFilter
 
 $fileHandle
 
 $securityScanner
 

Detailed Description

Definition at line 9 of file BaseReader.php.

Constructor & Destructor Documentation

◆ __construct()

PhpOffice\PhpSpreadsheet\Reader\BaseReader::__construct ( )

IReader constructor.

Implements PhpOffice\PhpSpreadsheet\Reader\IReader.

Definition at line 59 of file BaseReader.php.

60  {
61  $this->readFilter = new DefaultReadFilter();
62  }

Member Function Documentation

◆ getIncludeCharts()

PhpOffice\PhpSpreadsheet\Reader\BaseReader::getIncludeCharts ( )

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.

Returns
bool

Implements PhpOffice\PhpSpreadsheet\Reader\IReader.

Definition at line 88 of file BaseReader.php.

References PhpOffice\PhpSpreadsheet\Reader\BaseReader\$includeCharts.

◆ getLoadSheetsOnly()

PhpOffice\PhpSpreadsheet\Reader\BaseReader::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.

Returns
mixed

Implements PhpOffice\PhpSpreadsheet\Reader\IReader.

Definition at line 100 of file BaseReader.php.

References PhpOffice\PhpSpreadsheet\Reader\BaseReader\$loadSheetsOnly.

◆ getReadDataOnly()

PhpOffice\PhpSpreadsheet\Reader\BaseReader::getReadDataOnly ( )

Read data only? If this is true, then the Reader will only read data values for cells, it will not read any formatting information.

If false (the default) it will read data and formatting.

Returns
bool

Implements PhpOffice\PhpSpreadsheet\Reader\IReader.

Definition at line 64 of file BaseReader.php.

References PhpOffice\PhpSpreadsheet\Reader\BaseReader\$readDataOnly.

Referenced by PhpOffice\PhpSpreadsheet\Reader\Xlsx\getFromZipArchive().

+ Here is the caller graph for this function:

◆ getReadEmptyCells()

PhpOffice\PhpSpreadsheet\Reader\BaseReader::getReadEmptyCells ( )

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.

Returns
bool

Implements PhpOffice\PhpSpreadsheet\Reader\IReader.

Definition at line 76 of file BaseReader.php.

References PhpOffice\PhpSpreadsheet\Reader\BaseReader\$readEmptyCells.

◆ getReadFilter()

◆ getSecurityScanner()

PhpOffice\PhpSpreadsheet\Reader\BaseReader::getSecurityScanner ( )

◆ openFile()

PhpOffice\PhpSpreadsheet\Reader\BaseReader::openFile (   $pFilename)
protected

Open file for reading.

Parameters
string$pFilename

Definition at line 145 of file BaseReader.php.

References PhpOffice\PhpSpreadsheet\Reader\BaseReader\$fileHandle, and PhpOffice\PhpSpreadsheet\Shared\File\assertFile().

Referenced by PhpOffice\PhpSpreadsheet\Reader\Slk\canRead(), PhpOffice\PhpSpreadsheet\Reader\Html\canRead(), PhpOffice\PhpSpreadsheet\Reader\Csv\canRead(), PhpOffice\PhpSpreadsheet\Reader\Slk\canReadOrBust(), and PhpOffice\PhpSpreadsheet\Reader\Csv\openFileOrMemory().

145  : void
146  {
147  if ($pFilename) {
148  File::assertFile($pFilename);
149 
150  // Open file
151  $fileHandle = fopen($pFilename, 'rb');
152  } else {
153  $fileHandle = false;
154  }
155  if ($fileHandle !== false) {
156  $this->fileHandle = $fileHandle;
157  } else {
158  throw new ReaderException('Could not open file ' . $pFilename . ' for reading.');
159  }
160  }
static assertFile($filename)
Assert that given path is an existing file and is readable, otherwise throw exception.
Definition: File.php:143
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setIncludeCharts()

PhpOffice\PhpSpreadsheet\Reader\BaseReader::setIncludeCharts (   $pValue)

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.

Parameters
bool$pValue
Returns
IReader

Implements PhpOffice\PhpSpreadsheet\Reader\IReader.

Definition at line 93 of file BaseReader.php.

94  {
95  $this->includeCharts = (bool) $pValue;
96 
97  return $this;
98  }

◆ setLoadAllSheets()

PhpOffice\PhpSpreadsheet\Reader\BaseReader::setLoadAllSheets ( )

Set all sheets to load Tells the Reader to load all worksheets from the workbook.

Returns
IReader

Implements PhpOffice\PhpSpreadsheet\Reader\IReader.

Definition at line 116 of file BaseReader.php.

Referenced by PhpOffice\PhpSpreadsheet\Reader\BaseReader\setLoadSheetsOnly().

117  {
118  $this->loadSheetsOnly = null;
119 
120  return $this;
121  }
+ Here is the caller graph for this function:

◆ setLoadSheetsOnly()

PhpOffice\PhpSpreadsheet\Reader\BaseReader::setLoadSheetsOnly (   $value)

Set which sheets to load.

Parameters
mixed$valueThis 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
Returns
IReader

Implements PhpOffice\PhpSpreadsheet\Reader\IReader.

Definition at line 105 of file BaseReader.php.

References PhpOffice\PhpSpreadsheet\Reader\BaseReader\setLoadAllSheets().

106  {
107  if ($value === null) {
108  return $this->setLoadAllSheets();
109  }
110 
111  $this->loadSheetsOnly = is_array($value) ? $value : [$value];
112 
113  return $this;
114  }
setLoadAllSheets()
Set all sheets to load Tells the Reader to load all worksheets from the workbook. ...
Definition: BaseReader.php:116
+ Here is the call graph for this function:

◆ setReadDataOnly()

PhpOffice\PhpSpreadsheet\Reader\BaseReader::setReadDataOnly (   $pValue)

Set read data only Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information.

Set to false (the default) to advise the Reader to read both data and formatting for cells.

Parameters
bool$pValue
Returns
IReader

Implements PhpOffice\PhpSpreadsheet\Reader\IReader.

Definition at line 69 of file BaseReader.php.

70  {
71  $this->readDataOnly = (bool) $pValue;
72 
73  return $this;
74  }

◆ setReadEmptyCells()

PhpOffice\PhpSpreadsheet\Reader\BaseReader::setReadEmptyCells (   $pValue)

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.

Parameters
bool$pValue
Returns
IReader

Implements PhpOffice\PhpSpreadsheet\Reader\IReader.

Definition at line 81 of file BaseReader.php.

82  {
83  $this->readEmptyCells = (bool) $pValue;
84 
85  return $this;
86  }

◆ setReadFilter()

PhpOffice\PhpSpreadsheet\Reader\BaseReader::setReadFilter ( IReadFilter  $pValue)

Set read filter.

Returns
IReader

Implements PhpOffice\PhpSpreadsheet\Reader\IReader.

Definition at line 128 of file BaseReader.php.

129  {
130  $this->readFilter = $pValue;
131 
132  return $this;
133  }

Field Documentation

◆ $fileHandle

◆ $includeCharts

PhpOffice\PhpSpreadsheet\Reader\BaseReader::$includeCharts = false
protected

◆ $loadSheetsOnly

PhpOffice\PhpSpreadsheet\Reader\BaseReader::$loadSheetsOnly
protected

◆ $readDataOnly

◆ $readEmptyCells

PhpOffice\PhpSpreadsheet\Reader\BaseReader::$readEmptyCells = true
protected

◆ $readFilter

PhpOffice\PhpSpreadsheet\Reader\BaseReader::$readFilter
protected

◆ $securityScanner

PhpOffice\PhpSpreadsheet\Reader\BaseReader::$securityScanner
protected

The documentation for this class was generated from the following file: