PHP Класс Box\Spout\Reader\AbstractReader

Наследование: implements Box\Spout\Reader\ReaderInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$globalFunctionsHelper Helper to work with global functions
$isStreamOpened Indicates whether the stream is currently open
$options Reader's customized options

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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

Описание методов

close() публичный Метод

Closes the reader, preventing any additional reading
public close ( ) : void
Результат void

closeReader() абстрактный защищенный Метод

Closes the reader. To be used after reading the file.
abstract protected closeReader ( ) : AbstractReader
Результат AbstractReader

doesSupportStreamWrapper() абстрактный защищенный Метод

Returns whether stream wrappers are supported
abstract protected doesSupportStreamWrapper ( ) : boolean
Результат boolean

getConcreteSheetIterator() абстрактный защищенный Метод

Returns an iterator to iterate over sheets.
abstract protected getConcreteSheetIterator ( ) : Iterator
Результат Iterator To iterate over sheets

getFileRealPath() защищенный Метод

If the given path is a valid stream wrapper, returns the path unchanged.
protected getFileRealPath ( string $filePath ) : string
$filePath string
Результат string

getOptions() абстрактный защищенный Метод

Returns the reader's current options
abstract protected getOptions ( ) : ReaderOptions
Результат Box\Spout\Reader\Common\ReaderOptions

getSheetIterator() публичный Метод

Returns an iterator to iterate over sheets.
public getSheetIterator ( ) : Iterator
Результат Iterator To iterate over sheets

getStreamWrapperScheme() защищенный Метод

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
Результат string | null The stream wrapper scheme or NULL if not a stream wrapper

isPhpStream() защищенный Метод

..)
protected isPhpStream ( string $filePath ) : boolean
$filePath string Path of the file to be read
Результат boolean Whether the given path maps to a PHP stream

isStreamWrapper() защищенный Метод

..).
protected isStreamWrapper ( string $filePath ) : boolean
$filePath string Path of the file to be read
Результат boolean Whether the given path is an unsupported stream wrapper

isSupportedStreamWrapper() защищенный Метод

..). If the given path is a local path, returns true.
protected isSupportedStreamWrapper ( string $filePath ) : boolean
$filePath string Path of the file to be read
Результат boolean Whether the given path is an supported stream wrapper

open() публичный Метод

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
Результат void

openReader() абстрактный защищенный Метод

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
Результат void

setGlobalFunctionsHelper() публичный Метод

public setGlobalFunctionsHelper ( Box\Spout\Common\Helper\GlobalFunctionsHelper $globalFunctionsHelper ) : AbstractReader
$globalFunctionsHelper Box\Spout\Common\Helper\GlobalFunctionsHelper
Результат AbstractReader

setShouldFormatDates() публичный Метод

Sets whether date/time values should be returned as PHP objects or be formatted as strings.
public setShouldFormatDates ( boolean $shouldFormatDates ) : AbstractReader
$shouldFormatDates boolean
Результат AbstractReader

setShouldPreserveEmptyRows() публичный Метод

Sets whether empty rows should be returned or skipped.
public setShouldPreserveEmptyRows ( boolean $shouldPreserveEmptyRows ) : AbstractReader
$shouldPreserveEmptyRows boolean
Результат AbstractReader

Описание свойств

$globalFunctionsHelper защищенное свойство

Helper to work with global functions
protected $globalFunctionsHelper

$isStreamOpened защищенное свойство

Indicates whether the stream is currently open
protected $isStreamOpened

$options защищенное свойство

Reader's customized options
protected $options