PHP Class SimpleExcel\Parser\XMLParser

Author: Faisalman
Inheritance: extends BaseParser, implements SimpleExcel\Parser\IParser
Afficher le fichier Open project: faisalman/simple-excel-php Class Usage Examples

Protected Properties

Свойство Type Description
$file_extension string Defines valid file extension

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
getAttributes ( object $attrs_obj ) : array Extract attributes from SimpleXMLElement object
parseDOM ( SimpleXMLElement $xml ) : boolean Process the loaded file/string

Method Details

getCell() public méthode

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
Résultat array

getColumn() public méthode

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
Résultat array

getField() public méthode

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
Résultat array

getRow() public méthode

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
Résultat array

isColumnExists() public méthode

Check whether a specified column exists
public isColumnExists ( integer $col_num ) : boolean
$col_num integer Column number
Résultat boolean

isRowExists() public méthode

Check whether a specified row exists
public isRowExists ( integer $row_num ) : boolean
$row_num integer Row number
Résultat boolean

loadFile() public méthode

Load the XML file to be parsed
public loadFile ( string $file_path ) : boolean
$file_path string Path to XML file
Résultat boolean

loadString() public méthode

Load the string to be parsed
public loadString ( string $str ) : boolean
$str string String with XML format
Résultat boolean

Property Details

$file_extension protected_oe property

Defines valid file extension
protected string $file_extension
Résultat string