PHP Class Box\Spout\Reader\AbstractReader

Inheritance: implements Box\Spout\Reader\ReaderInterface
Afficher le fichier Open project: box/spout

Protected Properties

Свойство Type Description
$globalFunctionsHelper Helper to work with global functions
$isStreamOpened Indicates whether the stream is currently open
$options Reader's customized options

Méthodes publiques

Méthode Description
close ( ) : void Closes the reader, preventing any additional reading
getSheetIterator ( ) : Iterator Returns an iterator to iterate over sheets.
open ( string $filePath ) : void Prepares the reader to read the given file. It also makes sure that the file exists and is readable.
setGlobalFunctionsHelper ( Box\Spout\Common\Helper\GlobalFunctionsHelper $globalFunctionsHelper ) : AbstractReader
setShouldFormatDates ( boolean $shouldFormatDates ) : AbstractReader Sets whether date/time values should be returned as PHP objects or be formatted as strings.
setShouldPreserveEmptyRows ( boolean $shouldPreserveEmptyRows ) : AbstractReader Sets whether empty rows should be returned or skipped.

Méthodes protégées

Méthode Description
closeReader ( ) : AbstractReader Closes the reader. To be used after reading the file.
doesSupportStreamWrapper ( ) : boolean Returns whether stream wrappers are supported
getConcreteSheetIterator ( ) : Iterator Returns an iterator to iterate over sheets.
getFileRealPath ( string $filePath ) : string Returns the real path of the given path.
getOptions ( ) : ReaderOptions Returns the reader's current options
getStreamWrapperScheme ( string $filePath ) : string | null Returns the scheme of the custom stream wrapper, if the path indicates a stream wrapper is used.
isPhpStream ( string $filePath ) : boolean Checks if a path is a PHP stream (like php://output, php://memory, .
isStreamWrapper ( string $filePath ) : boolean Checks if the given path is an unsupported stream wrapper (like local path, php://temp, mystream://foo/bar.
isSupportedStreamWrapper ( string $filePath ) : boolean Checks if the given path is an supported stream wrapper (like php://temp, mystream://foo/bar.
openReader ( string $filePath ) : void Opens the file at the given file path to make it ready to be read

Method Details

close() public méthode

Closes the reader, preventing any additional reading
public close ( ) : void
Résultat void

closeReader() abstract protected méthode

Closes the reader. To be used after reading the file.
abstract protected closeReader ( ) : AbstractReader
Résultat AbstractReader

doesSupportStreamWrapper() abstract protected méthode

Returns whether stream wrappers are supported
abstract protected doesSupportStreamWrapper ( ) : boolean
Résultat boolean

getConcreteSheetIterator() abstract protected méthode

Returns an iterator to iterate over sheets.
abstract protected getConcreteSheetIterator ( ) : Iterator
Résultat Iterator To iterate over sheets

getFileRealPath() protected méthode

If the given path is a valid stream wrapper, returns the path unchanged.
protected getFileRealPath ( string $filePath ) : string
$filePath string
Résultat string

getOptions() abstract protected méthode

Returns the reader's current options
abstract protected getOptions ( ) : ReaderOptions
Résultat Box\Spout\Reader\Common\ReaderOptions

getSheetIterator() public méthode

Returns an iterator to iterate over sheets.
public getSheetIterator ( ) : Iterator
Résultat Iterator To iterate over sheets

getStreamWrapperScheme() protected méthode

For example, php://temp => php, s3://path/to/file => s3...
protected getStreamWrapperScheme ( string $filePath ) : string | null
$filePath string Path of the file to be read
Résultat string | null The stream wrapper scheme or NULL if not a stream wrapper

isPhpStream() protected méthode

..)
protected isPhpStream ( string $filePath ) : boolean
$filePath string Path of the file to be read
Résultat boolean Whether the given path maps to a PHP stream

isStreamWrapper() protected méthode

..).
protected isStreamWrapper ( string $filePath ) : boolean
$filePath string Path of the file to be read
Résultat boolean Whether the given path is an unsupported stream wrapper

isSupportedStreamWrapper() protected méthode

..). If the given path is a local path, returns true.
protected isSupportedStreamWrapper ( string $filePath ) : boolean
$filePath string Path of the file to be read
Résultat boolean Whether the given path is an supported stream wrapper

open() public méthode

Prepares the reader to read the given file. It also makes sure that the file exists and is readable.
public open ( string $filePath ) : void
$filePath string Path of the file to be read
Résultat void

openReader() abstract protected méthode

Opens the file at the given file path to make it ready to be read
abstract protected openReader ( string $filePath ) : void
$filePath string Path of the file to be read
Résultat void

setGlobalFunctionsHelper() public méthode

public setGlobalFunctionsHelper ( Box\Spout\Common\Helper\GlobalFunctionsHelper $globalFunctionsHelper ) : AbstractReader
$globalFunctionsHelper Box\Spout\Common\Helper\GlobalFunctionsHelper
Résultat AbstractReader

setShouldFormatDates() public méthode

Sets whether date/time values should be returned as PHP objects or be formatted as strings.
public setShouldFormatDates ( boolean $shouldFormatDates ) : AbstractReader
$shouldFormatDates boolean
Résultat AbstractReader

setShouldPreserveEmptyRows() public méthode

Sets whether empty rows should be returned or skipped.
public setShouldPreserveEmptyRows ( boolean $shouldPreserveEmptyRows ) : AbstractReader
$shouldPreserveEmptyRows boolean
Résultat AbstractReader

Property Details

$globalFunctionsHelper protected_oe property

Helper to work with global functions
protected $globalFunctionsHelper

$isStreamOpened protected_oe property

Indicates whether the stream is currently open
protected $isStreamOpened

$options protected_oe property

Reader's customized options
protected $options