PHPExcel_Style

# Class: PHPExcel_Style_Protection

Source Location: /PHPExcel/Style/Protection.php

### Class Overview

PHPExcel_Style_Protection

#### Author(s):

#### Copyright:

- Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)

Implements interfaces:

- PHPExcel_IComparable

### Constants

- PROTECTION_INHERIT
- PROTECTION_PROTECTED
- PROTECTION_UNPROTECTED

### Methods

- __construct
- applyFromArray
- bindParent
- getActiveCell
- getActiveSheet
- getHashCode
- getHidden
- getIsSupervisor
- getLocked
- getSelectedCells
- getSharedComponent
- getStyleArray
- setHidden
- setLocked
- __clone

### Class Details

[line 36]
PHPExcel_Style_Protection

#### Tags:

copyright: | Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)

[ Top ]

### Class Methods

### constructor __construct [line 88]

`PHPExcel_Style_Protection __construct( [boolean $isSupervisor = false], [boolean $isConditional = false])`

Create a new PHPExcel_Style_Protection

#### Tags:

access: | public

#### 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

[ Top ]

### method applyFromArray [line 187]

`PHPExcel_Style_Protection applyFromArray( [array $pStyles = null])`

Apply styles from array

1. $objPHPExcel-> getActiveSheet ()->getStyle('B2')-> getLocked ()-> applyFromArray ( array('locked' => true, 'hidden' => false) );

#### Tags:

throws: | Exception
access: | public

#### Parameters:

array | $pStyles | Array containing style information

[ Top ]

### method bindParent [line 106]

`PHPExcel_Style_Protection bindParent( PHPExcel_Style $parent)`

Bind parent. Only used for supervisor

#### Tags:

access: | public

#### Parameters:

PHPExcel_Style | $parent |

[ Top ]

### method getActiveCell [line 160]

`string getActiveCell( )`

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

#### Tags:

return: | E.g. 'A1'
access: | public

[ Top ]

### method getActiveSheet [line 138]

`PHPExcel_Worksheet getActiveSheet( )`

Get the currently active sheet. Only used for supervisor

#### Tags:

access: | public

[ Top ]

### method getHashCode [line 266]

`string getHashCode( )`

Get hash code

#### Tags:

return: | Hash code
access: | public

[ Top ]

### method getHidden [line 238]

`string getHidden( )`

Get hidden

#### Tags:

access: | public

[ Top ]

### method getIsSupervisor [line 117]

`boolean getIsSupervisor( )`

Is this a supervisor or a real style component?

#### Tags:

access: | public

[ Top ]

### method getLocked [line 210]

`string getLocked( )`

Get locked

#### Tags:

access: | public

[ Top ]

### method getSelectedCells [line 149]

`string getSelectedCells( )`

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

#### Tags:

return: | E.g. 'A1'
access: | public

[ Top ]

### method getSharedComponent [line 128]

`PHPExcel_Style_Protection getSharedComponent( )`

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

Only used for style supervisor

#### Tags:

access: | public

[ Top ]

### method getStyleArray [line 171]

`array getStyleArray( array $array)`

Build style array from subcomponents

#### Tags:

access: | public

#### Parameters:

array | $array |

[ Top ]

### method setHidden [line 251]

`PHPExcel_Style_Protection setHidden( [string $pValue = self::PROTECTION_INHERIT])`

Set hidden

#### Tags:

access: | public

#### Parameters:

string | $pValue |

[ Top ]

### method setLocked [line 223]

`PHPExcel_Style_Protection setLocked( [string $pValue = self::PROTECTION_INHERIT])`

Set locked

#### Tags:

access: | public

#### Parameters:

string | $pValue |

[ Top ]

### method __clone [line 280]

`void __clone( )`

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

#### Tags:

access: | public

[ Top ]

### Class Constants

#### PROTECTION_INHERIT = 'inherit'

[line 39]

Protection styles
[ Top ]

#### PROTECTION_PROTECTED = 'protected'

[line 40]

[ Top ]

#### PROTECTION_UNPROTECTED = 'unprotected'

[line 41]

[ Top ]

Documentation generated on Fri, 12 Oct 2012 00:17:30 +0200 by phpDocumentor 1.4.4