Properties

$isSupervisor

$isSupervisor : boolean

Supervisor?

Type

boolean

$parentPropertyName

$parentPropertyName : null|string

Parent property name.

Type

null|string

$index

$index : integer

Index of style in collection. Only used for real style.

Type

integer

$quotePrefix

$quotePrefix : boolean

Use Quote Prefix when displaying in cell editor. Only used for real style.

Type

boolean

Methods

__construct()

__construct(boolean  $isSupervisor = false, boolean  $isConditional = false) 

Create a new Style.

Parameters

boolean $isSupervisor

Flag indicating if this is a supervisor or not Leave this value at default unless you understand exactly what its ramifications are

boolean $isConditional

Flag indicating if this is a conditional style or not Leave this value at default unless you understand exactly what its ramifications are

getIsSupervisor()

getIsSupervisor() : boolean

Is this a supervisor or a cell style component?

Returns

boolean

getSelectedCells()

getSelectedCells() : string

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor.

Returns

string —

E.g. 'A1'

getActiveCell()

getActiveCell() : string

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor.

Returns

string —

E.g. 'A1'

__clone()

__clone() 

Implement PHP __clone to create a deep clone, not just a shallow copy.

getSharedComponent()

getSharedComponent() : \PhpOffice\PhpSpreadsheet\Style\Style

Get the shared style component for the currently active cell in currently active sheet.

Only used for style supervisor.

Returns

\PhpOffice\PhpSpreadsheet\Style\Style

getStyleArray()

getStyleArray(array  $array) : array

Build style array from subcomponents.

Parameters

array $array

Returns

array

applyFromArray()

applyFromArray(array  $pStyles, boolean  $pAdvanced = true) : \PhpOffice\PhpSpreadsheet\Style\Style

Apply styles from array.

$spreadsheet->getActiveSheet()->getStyle('B2')->applyFromArray( [ 'font' => [ 'name' => 'Arial', 'bold' => true, 'italic' => false, 'underline' => Font::UNDERLINE_DOUBLE, 'strikethrough' => false, 'color' => [ 'rgb' => '808080' ] ], 'borders' => [ 'bottom' => [ 'borderStyle' => Border::BORDER_DASHDOT, 'color' => [ 'rgb' => '808080' ] ], 'top' => [ 'borderStyle' => Border::BORDER_DASHDOT, 'color' => [ 'rgb' => '808080' ] ] ], 'quotePrefix' => true ] );

Parameters

array $pStyles

Array containing style information

boolean $pAdvanced

advanced mode for setting borders

Returns

\PhpOffice\PhpSpreadsheet\Style\Style

getConditionalStyles()

getConditionalStyles() : array<mixed,\PhpOffice\PhpSpreadsheet\Style\Conditional>

Get Conditional Styles. Only used on supervisor.

Returns

array<mixed,\PhpOffice\PhpSpreadsheet\Style\Conditional>

getQuotePrefix()

getQuotePrefix() : boolean

Get quote prefix.

Returns

boolean

getHashCode()

getHashCode() : string

Get hash code.

Returns

string —

Hash code

getIndex()

getIndex() : integer

Get own index in style collection.

Returns

integer

setIndex()

setIndex(integer  $pValue) 

Set own index in style collection.

Parameters

integer $pValue