Constants

PROTECTION_INHERIT

PROTECTION_INHERIT = 'inherit'

Protection styles

PROTECTION_PROTECTED

PROTECTION_PROTECTED = 'protected'

PROTECTION_UNPROTECTED

PROTECTION_UNPROTECTED = 'unprotected'

Properties

$_isSupervisor

$_isSupervisor : bool

Supervisor?

Type

bool

$_parent

$_parent : \PHPExcel_Style

Parent. Only used for supervisor

Type

PHPExcel_Style

$_locked

$_locked : string

Locked

Type

string

$_hidden

$_hidden : string

Hidden

Type

string

Methods

__construct()

__construct(bool  $isSupervisor = FALSE, bool  $isConditional = FALSE) : mixed

Create a new PHPExcel_Style_Protection

Parameters

bool $isSupervisor

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

bool $isConditional

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

Returns

mixed —

bindParent()

bindParent(\PHPExcel  $parent, mixed  $parentPropertyName = NULL) : \PHPExcel_Style_Supervisor

Bind parent. Only used for supervisor

Parameters

\PHPExcel $parent
mixed $parentPropertyName

Returns

\PHPExcel_Style_Supervisor —

getIsSupervisor()

getIsSupervisor() : bool

Is this a supervisor or a cell style component?

Returns

bool —

getActiveSheet()

getActiveSheet() : \PHPExcel_Worksheet

Get the currently active sheet. Only used for supervisor

Returns

\PHPExcel_Worksheet —

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() : mixed

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

Returns

mixed —

getSharedComponent()

getSharedComponent() : \PHPExcel_Style_Protection

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

Only used for style supervisor

Returns

\PHPExcel_Style_Protection —

getStyleArray()

getStyleArray(array  $array) : array

Build style array from subcomponents

Parameters

array $array

Returns

array —

applyFromArray()

applyFromArray(array  $pStyles = NULL) : \PHPExcel_Style_Protection

Apply styles from array

$objPHPExcel->getActiveSheet()->getStyle('B2')->getLocked()->applyFromArray( array( 'locked' => TRUE, 'hidden' => FALSE ) );

Parameters

array $pStyles

Array containing style information

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Style_Protection —

getLocked()

getLocked() : string

Get locked

Returns

string —

setLocked()

setLocked(string  $pValue = self::PROTECTION_INHERIT) : \PHPExcel_Style_Protection

Set locked

Parameters

string $pValue

Returns

\PHPExcel_Style_Protection —

getHidden()

getHidden() : string

Get hidden

Returns

string —

setHidden()

setHidden(string  $pValue = self::PROTECTION_INHERIT) : \PHPExcel_Style_Protection

Set hidden

Parameters

string $pValue

Returns

\PHPExcel_Style_Protection —

getHashCode()

getHashCode() : string

Get hash code

Returns

string —

Hash code