PHP Класс SimpleExcel\Parser\XMLParser

Автор: Faisalman
Наследование: extends BaseParser, implements SimpleExcel\Parser\IParser
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$file_extension string Defines valid file extension

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

Метод Описание
getCell ( integer $row_num, integer $col_num, integer $val_only = true ) : array Get value of the specified cell
getColumn ( integer $col_num, boolean $val_only = TRUE ) : array Get data of the specified column as an array
getField ( boolean $val_only = TRUE ) : array Get data of all cells as an array
getRow ( integer $row_num, boolean $val_only = TRUE ) : array Get data of the specified row as an array
isColumnExists ( integer $col_num ) : boolean Check whether a specified column exists
isRowExists ( integer $row_num ) : boolean Check whether a specified row exists
loadFile ( string $file_path ) : boolean Load the XML file to be parsed
loadString ( string $str ) : boolean Load the string to be parsed

Приватные методы

Метод Описание
getAttributes ( object $attrs_obj ) : array Extract attributes from SimpleXMLElement object
parseDOM ( SimpleXMLElement $xml ) : boolean Process the loaded file/string

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

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

Get value of the specified cell
public getCell ( integer $row_num, integer $col_num, integer $val_only = true ) : array
$row_num integer Row number
$col_num integer Column number
$val_only integer Whether returns only it's value or complete data
Результат array

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

Get data of the specified column as an array
public getColumn ( integer $col_num, boolean $val_only = TRUE ) : array
$col_num integer Column number
$val_only boolean Returns (value only | complete data) for every cell, default to TRUE
Результат array

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

Get data of all cells as an array
public getField ( boolean $val_only = TRUE ) : array
$val_only boolean Returns (value only | complete data) for every cell, default to TRUE
Результат array

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

Get data of the specified row as an array
public getRow ( integer $row_num, boolean $val_only = TRUE ) : array
$row_num integer Row number
$val_only boolean Returns (value only | complete data) for every cell, default to TRUE
Результат array

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

Check whether a specified column exists
public isColumnExists ( integer $col_num ) : boolean
$col_num integer Column number
Результат boolean

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

Check whether a specified row exists
public isRowExists ( integer $row_num ) : boolean
$row_num integer Row number
Результат boolean

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

Load the XML file to be parsed
public loadFile ( string $file_path ) : boolean
$file_path string Path to XML file
Результат boolean

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

Load the string to be parsed
public loadString ( string $str ) : boolean
$str string String with XML format
Результат boolean

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

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

Defines valid file extension
protected string $file_extension
Результат string