class Protection extends Supervisor (View source)

Constants

PROTECTION_INHERIT

Protection styles

PROTECTION_PROTECTED

PROTECTION_UNPROTECTED

Properties

protected bool $isSupervisor Supervisor? from Supervisor
protected Spreadsheet|Style $parent Parent. Only used for supervisor. from Supervisor
protected null|string $parentPropertyName Parent property name. from Supervisor
protected string $locked Locked.
protected string $hidden Hidden.

Methods

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

Create a new Protection.

bindParent(Spreadsheet|Style $parent, null|string $parentPropertyName = null)

Bind parent. Only used for supervisor.

bool
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)

Apply styles from array.

string
getLocked()

Get locked.

setLocked(string $pValue)

Set locked.

string
getHidden()

Get hidden.

setHidden(string $pValue)

Set hidden.

string
getHashCode()

Get hash code.

Details

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

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

Supervisor bindParent(Spreadsheet|Style $parent, null|string $parentPropertyName = null)

Bind parent. Only used for supervisor.

Parameters

Spreadsheet|Style $parent
null|string $parentPropertyName

Return Value

Supervisor

bool getIsSupervisor()

Is this a supervisor or a cell style component?

Return Value

bool

Worksheet getActiveSheet()

Get the currently active sheet. Only used for supervisor.

Return Value

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.

Protection getSharedComponent()

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

Only used for style supervisor.

Return Value

Protection

array getStyleArray(array $array)

Build style array from subcomponents.

Parameters

array $array

Return Value

array

Protection applyFromArray(array $pStyles)

Apply styles from array.

$spreadsheet->getActiveSheet()->getStyle('B2')->getLocked()->applyFromArray( [ 'locked' => TRUE, 'hidden' => FALSE ] );

Parameters

array $pStyles Array containing style information

Return Value

Protection

Exceptions

Exception

string getLocked()

Get locked.

Return Value

string

Protection setLocked(string $pValue)

Set locked.

Parameters

string $pValue see self::PROTECTION_*

Return Value

Protection

string getHidden()

Get hidden.

Return Value

string

Protection setHidden(string $pValue)

Set hidden.

Parameters

string $pValue see self::PROTECTION_*

Return Value

Protection

string getHashCode()

Get hash code.

Return Value

string Hash code