class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable

PHPExcel_Style

Copyright (c) 2006 - 2015 PHPExcel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Methods

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

Create a new PHPExcel_Style

bindParent($parent, $parentPropertyName = null)

Bind parent. Only used for supervisor

boolean
getIsSupervisor()

Is this a supervisor or a cell style component?

getActiveSheet()

Get the currently active sheet. Only used for supervisor

string
getSelectedCells()

Get the currently active cell coordinate in currently active sheet.

string
getActiveCell()

Get the currently active cell coordinate in currently active sheet.

__clone()

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

getSharedComponent()

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

getParent()

Get parent. Only used for style supervisor

array
getStyleArray(array $array)

Build style array from subcomponents

applyFromArray(array $pStyles = null, boolean $pAdvanced = true)

Apply styles from array

getConditionalStyles()

Get Conditional Styles. Only used on supervisor.

setConditionalStyles(PHPExcel_Style_Conditional[] $pValue = null)

Set Conditional Styles. Only used on supervisor.

boolean
getQuotePrefix()

Get quote prefix

setQuotePrefix(boolean $pValue)

Set quote prefix

string
getHashCode()

Get hash code

int
getIndex()

Get own index in style collection

setIndex(int $pValue)

Set own index in style collection

Details

at line 112
__construct(boolean $isSupervisor = false, boolean $isConditional = false)

Create a new PHPExcel_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

PHPExcel_Style_Supervisor bindParent($parent, $parentPropertyName = null)

Bind parent. Only used for supervisor

Parameters

$parent
$parentPropertyName

Return Value

PHPExcel_Style_Supervisor

boolean getIsSupervisor()

Is this a supervisor or a cell style component?

Return Value

boolean

PHPExcel_Worksheet getActiveSheet()

Get the currently active sheet. Only used for supervisor

Return Value

PHPExcel_Worksheet

string getSelectedCells()

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Return Value

string E.g. 'A1'

string getActiveCell()

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Return Value

string E.g. 'A1'

__clone()

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

at line 143
PHPExcel_Style getSharedComponent()

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

Only used for style supervisor

Return Value

PHPExcel_Style

at line 162
PHPExcel getParent()

Get parent. Only used for style supervisor

Return Value

PHPExcel

at line 173
array getStyleArray(array $array)

Build style array from subcomponents

Parameters

array $array

Return Value

array

at line 218
PHPExcel_Style applyFromArray(array $pStyles = null, boolean $pAdvanced = true)

Apply styles from array

$objPHPExcel->getActiveSheet()->getStyle('B2')->applyFromArray( array( 'font' => array( 'name' => 'Arial', 'bold' => true, 'italic' => false, 'underline' => PHPExcelStyleFont::UNDERLINEDOUBLE, 'strike' => false, 'color' => array( 'rgb' => '808080' ) ), 'borders' => array( 'bottom' => array( 'style' => PHPExcelStyleBorder::BORDERDASHDOT, 'color' => array( 'rgb' => '808080' ) ), 'top' => array( 'style' => PHPExcelStyleBorder::BORDER_DASHDOT, 'color' => array( 'rgb' => '808080' ) ) ), 'quotePrefix' => true ) );

Parameters

array $pStyles Array containing style information
boolean $pAdvanced Advanced mode for setting borders.

Return Value

PHPExcel_Style

Exceptions

PHPExcel_Exception

at line 486
PHPExcel_Style_Fill getFill()

Get Fill

Return Value

PHPExcel_Style_Fill

at line 496
PHPExcel_Style_Font getFont()

Get Font

Return Value

PHPExcel_Style_Font

at line 507
PHPExcel_Style setFont(PHPExcel_Style_Font $font)

Set font

Parameters

PHPExcel_Style_Font $font

Return Value

PHPExcel_Style

at line 518
PHPExcel_Style_Borders getBorders()

Get Borders

Return Value

PHPExcel_Style_Borders

at line 528
PHPExcel_Style_Alignment getAlignment()

Get Alignment

at line 538
PHPExcel_Style_NumberFormat getNumberFormat()

Get Number Format

at line 548
PHPExcel_Style_Conditional[] getConditionalStyles()

Get Conditional Styles. Only used on supervisor.

at line 559
PHPExcel_Style setConditionalStyles(PHPExcel_Style_Conditional[] $pValue = null)

Set Conditional Styles. Only used on supervisor.

Parameters

PHPExcel_Style_Conditional[] $pValue Array of condtional styles

Return Value

PHPExcel_Style

at line 572
PHPExcel_Style_Protection getProtection()

Get Protection

at line 582
boolean getQuotePrefix()

Get quote prefix

Return Value

boolean

at line 595
setQuotePrefix(boolean $pValue)

Set quote prefix

Parameters

boolean $pValue

at line 614
string getHashCode()

Get hash code

Return Value

string Hash code

at line 639
int getIndex()

Get own index in style collection

Return Value

int

at line 649
setIndex(int $pValue)

Set own index in style collection

Parameters

int $pValue