class PHPExcel_Style_Protection extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable

PHPExcelStyleProtection

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

Constants

PROTECTION_INHERIT

Protection styles

PROTECTION_PROTECTED

PROTECTION_UNPROTECTED

Methods

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

Create a new PHPExcelStyleProtection

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.

array
getStyleArray(array $array)

Build style array from subcomponents

applyFromArray(array $pStyles = null)

Apply styles from array

string
getLocked()

Get locked

setLocked(string $pValue = self::PROTECTION_INHERIT)

Set locked

string
getHidden()

Get hidden

setHidden(string $pValue = self::PROTECTION_INHERIT)

Set hidden

string
getHashCode()

Get hash code

Details

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

Create a new PHPExcelStyleProtection

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 86
PHPExcel_Style_Protection getSharedComponent()

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

Only used for style supervisor

at line 97
array getStyleArray(array $array)

Build style array from subcomponents

Parameters

array $array

Return Value

array

at line 118
PHPExcel_Style_Protection applyFromArray(array $pStyles = null)

Apply styles from array

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

Parameters

array $pStyles Array containing style information

Return Value

PHPExcel_Style_Protection

Exceptions

PHPExcel_Exception

at line 142
string getLocked()

Get locked

Return Value

string

at line 156
PHPExcel_Style_Protection setLocked(string $pValue = self::PROTECTION_INHERIT)

Set locked

Parameters

string $pValue

Return Value

PHPExcel_Style_Protection

at line 172
string getHidden()

Get hidden

Return Value

string

at line 186
PHPExcel_Style_Protection setHidden(string $pValue = self::PROTECTION_INHERIT)

Set hidden

Parameters

string $pValue

Return Value

PHPExcel_Style_Protection

at line 202
string getHashCode()

Get hash code

Return Value

string Hash code