PHP Class SimpleExcel\Parser\BaseParser

Author: Faisalman
Inheritance: implements SimpleExcel\Parser\IParser
Show file Open project: faisalman/simple-excel-php Class Usage Examples

Protected Properties

Property Type Description
$file_extension string Defines valid file extension
$table_arr array Holds the parsed result

Public Methods

Method Description
__construct ( string $file_url = NULL )
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
isCellExists ( integer $row_num, integer $col_num ) : boolean Check whether cell with specified row & column exists
isColumnExists ( integer $col_num ) : boolean Check whether a specified column exists
isFieldExists ( ) : boolean Check whether table exists
isFileReady ( string $file_path ) : boolean Check whether file exists, valid, and readable
isRowExists ( integer $row_num ) : boolean Check whether a specified row exists

Method Details

__construct() public method

public __construct ( string $file_url = NULL )
$file_url string Path to file (optional)

getCell() public method

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
return array

getColumn() public method

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
return array

getField() public method

Get data of all cells as an array
public getField ( boolean $val_only = TRUE ) : array
$val_only boolean
return array

getRow() public method

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
return array

isCellExists() public method

Check whether cell with specified row & column exists
public isCellExists ( integer $row_num, integer $col_num ) : boolean
$row_num integer Row number
$col_num integer Column number
return boolean

isColumnExists() public method

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

isFieldExists() public method

Check whether table exists
public isFieldExists ( ) : boolean
return boolean

isFileReady() public method

Check whether file exists, valid, and readable
public isFileReady ( string $file_path ) : boolean
$file_path string Path to file
return boolean

isRowExists() public method

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

Property Details

$file_extension protected property

Defines valid file extension
protected string $file_extension
return string

$table_arr protected property

Holds the parsed result
protected array $table_arr
return array