PHP Class Box\Spout\Writer\Common\Helper\CellHelper

Show file Open project: box/spout Class Usage Examples

Public Methods

Method Description
getCellIndexFromColumnIndex ( integer $columnIndex ) : string Returns the cell index (base 26) associated to the base 10 column index.
isBoolean ( $value ) : boolean Returns whether the given value is boolean.
isEmpty ( $value ) : boolean
isNonEmptyString ( $value ) : boolean
isNumeric ( $value ) : boolean Returns whether the given value is numeric.

Method Details

getCellIndexFromColumnIndex() public static method

Excel uses A to Z letters for column indexing, where A is the 1st column, Z is the 26th and AA is the 27th. The mapping is zero based, so that 0 maps to A, B maps to 1, Z to 25 and AA to 26.
public static getCellIndexFromColumnIndex ( integer $columnIndex ) : string
$columnIndex integer The Excel column index (0, 42, ...)
return string The associated cell index ('A', 'BC', ...)

isBoolean() public static method

"true"/"false" and 0/1 are not booleans.
public static isBoolean ( $value ) : boolean
$value
return boolean Whether the given value is boolean

isEmpty() public static method

public static isEmpty ( $value ) : boolean
$value
return boolean Whether the given value is considered "empty"

isNonEmptyString() public static method

public static isNonEmptyString ( $value ) : boolean
$value
return boolean Whether the given value is a non empty string

isNumeric() public static method

A numeric value is from type "integer" or "double" ("float" is not returned by gettype).
public static isNumeric ( $value ) : boolean
$value
return boolean Whether the given value is numeric