PHP Class Box\Spout\Writer\Common\Sheet

Show file Open project: box/spout Class Usage Examples

Protected Properties

Property Type Description
$SHEETS_NAME_USED Associative array [SHEET_INDEX] => [SHEET_NAME] keeping track of sheets' name to enforce uniqueness
$index Index of the sheet, based on order in the workbook (zero-based)
$name Name of the sheet
$stringHelper Box\Spout\Common\Helper\StringHelper

Public Methods

Method Description
__construct ( integer $sheetIndex )
getIndex ( ) : integer
getName ( ) : string
setName ( string $name ) : Sheet Sets the name of the sheet. Note that Excel has some restrictions on the name: - it should not be blank - it should not exceed 31 characters - it should not contain these characters: \ / ? * : [ or ] - it should be unique

Protected Methods

Method Description
doesContainInvalidCharacters ( string $name ) : boolean Returns whether the given name contains at least one invalid character.
doesStartOrEndWithSingleQuote ( string $name ) : boolean Returns whether the given name starts or ends with a single quote
isNameUnique ( string $name ) : boolean Returns whether the given name is unique.
throwIfNameIsInvalid ( string $name ) : void Throws an exception if the given sheet's name is not valid.

Method Details

__construct() public method

public __construct ( integer $sheetIndex )
$sheetIndex integer Index of the sheet, based on order in the workbook (zero-based)

doesContainInvalidCharacters() protected method

Returns whether the given name contains at least one invalid character.
See also: Sheet::$INVALID_CHARACTERS_IN_SHEET_NAME for the full list.
protected doesContainInvalidCharacters ( string $name ) : boolean
$name string
return boolean TRUE if the name contains invalid characters, FALSE otherwise.

doesStartOrEndWithSingleQuote() protected method

Returns whether the given name starts or ends with a single quote
protected doesStartOrEndWithSingleQuote ( string $name ) : boolean
$name string
return boolean TRUE if the name starts or ends with a single quote, FALSE otherwise.

getIndex() public method

public getIndex ( ) : integer
return integer Index of the sheet, based on order in the workbook (zero-based)

getName() public method

public getName ( ) : string
return string Name of the sheet

isNameUnique() protected method

Returns whether the given name is unique.
protected isNameUnique ( string $name ) : boolean
$name string
return boolean TRUE if the name is unique, FALSE otherwise.

setName() public method

Sets the name of the sheet. Note that Excel has some restrictions on the name: - it should not be blank - it should not exceed 31 characters - it should not contain these characters: \ / ? * : [ or ] - it should be unique
public setName ( string $name ) : Sheet
$name string Name of the sheet
return Sheet

throwIfNameIsInvalid() protected method

Throws an exception if the given sheet's name is not valid.
See also: Sheet::setName for validity rules.
protected throwIfNameIsInvalid ( string $name ) : void
$name string
return void

Property Details

$SHEETS_NAME_USED protected static property

Associative array [SHEET_INDEX] => [SHEET_NAME] keeping track of sheets' name to enforce uniqueness
protected static $SHEETS_NAME_USED

$index protected property

Index of the sheet, based on order in the workbook (zero-based)
protected $index

$name protected property

Name of the sheet
protected $name

$stringHelper protected property

protected StringHelper,Box\Spout\Common\Helper $stringHelper
return Box\Spout\Common\Helper\StringHelper