ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
PHPExcel_Style_Protection Class Reference
+ Inheritance diagram for PHPExcel_Style_Protection:
+ Collaboration diagram for PHPExcel_Style_Protection:

Public Member Functions

 __construct ($isSupervisor=FALSE, $isConditional=FALSE)
 Create a new PHPExcel_Style_Protection. More...
 
 getSharedComponent ()
 Get the shared style component for the currently active cell in currently active sheet. More...
 
 getStyleArray ($array)
 Build style array from subcomponents. More...
 
 applyFromArray ($pStyles=NULL)
 Apply styles from array. More...
 
 getLocked ()
 Get locked. More...
 
 setLocked ($pValue=self::PROTECTION_INHERIT)
 Set locked. More...
 
 getHidden ()
 Get hidden. More...
 
 setHidden ($pValue=self::PROTECTION_INHERIT)
 Set hidden. More...
 
 getHashCode ()
 Get hash code. More...
 
- Public Member Functions inherited from PHPExcel_Style_Supervisor
 __construct ($isSupervisor=FALSE)
 Create a new PHPExcel_Style_Alignment. More...
 
 bindParent ($parent, $parentPropertyName=NULL)
 Bind parent. More...
 
 getIsSupervisor ()
 Is this a supervisor or a cell style component? More...
 
 getActiveSheet ()
 Get the currently active sheet. More...
 
 getSelectedCells ()
 Get the currently active cell coordinate in currently active sheet. More...
 
 getActiveCell ()
 Get the currently active cell coordinate in currently active sheet. More...
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy. More...
 
 getHashCode ()
 Get hash code. More...
 

Data Fields

const PROTECTION_INHERIT = 'inherit'
 Protection styles. More...
 
const PROTECTION_PROTECTED = 'protected'
 
const PROTECTION_UNPROTECTED = 'unprotected'
 

Protected Attributes

 $_locked
 
 $_hidden
 
- Protected Attributes inherited from PHPExcel_Style_Supervisor
 $_isSupervisor
 
 $_parent
 

Detailed Description

Definition at line 36 of file Protection.php.

Constructor & Destructor Documentation

◆ __construct()

PHPExcel_Style_Protection::__construct (   $isSupervisor = FALSE,
  $isConditional = FALSE 
)

Create a new PHPExcel_Style_Protection.

@param      boolean $isSupervisor   Flag indicating if this is a supervisor or not
                                                                    Leave this value at default unless you understand exactly what
                                                                            its ramifications are
@param      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

Definition at line 67 of file Protection.php.

68 {
69 // Supervisor?
70 parent::__construct($isSupervisor);
71
72 // Initialise values
73 if (!$isConditional) {
74 $this->_locked = self::PROTECTION_INHERIT;
75 $this->_hidden = self::PROTECTION_INHERIT;
76 }
77 }
const PROTECTION_INHERIT
Protection styles.
Definition: Protection.php:39

References PROTECTION_INHERIT.

Member Function Documentation

◆ applyFromArray()

PHPExcel_Style_Protection::applyFromArray (   $pStyles = NULL)

Apply styles from array.

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

Parameters
array$pStylesArray containing style information
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Style_Protection

Definition at line 117 of file Protection.php.

117 {
118 if (is_array($pStyles)) {
119 if ($this->_isSupervisor) {
120 $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
121 } else {
122 if (isset($pStyles['locked'])) {
123 $this->setLocked($pStyles['locked']);
124 }
125 if (isset($pStyles['hidden'])) {
126 $this->setHidden($pStyles['hidden']);
127 }
128 }
129 } else {
130 throw new PHPExcel_Exception("Invalid style array passed.");
131 }
132 return $this;
133 }
getStyleArray($array)
Build style array from subcomponents.
Definition: Protection.php:96
setHidden($pValue=self::PROTECTION_INHERIT)
Set hidden.
Definition: Protection.php:181
setLocked($pValue=self::PROTECTION_INHERIT)
Set locked.
Definition: Protection.php:153
getActiveSheet()
Get the currently active sheet.
Definition: Supervisor.php:92
getSelectedCells()
Get the currently active cell coordinate in currently active sheet.
Definition: Supervisor.php:103

References PHPExcel_Style_Supervisor\getActiveSheet(), PHPExcel_Style_Supervisor\getSelectedCells(), getStyleArray(), setHidden(), and setLocked().

+ Here is the call graph for this function:

◆ getHashCode()

PHPExcel_Style_Protection::getHashCode ( )

Get hash code.

Returns
string Hash code

Implements PHPExcel_IComparable.

Definition at line 196 of file Protection.php.

196 {
197 if ($this->_isSupervisor) {
198 return $this->getSharedComponent()->getHashCode();
199 }
200 return md5(
201 $this->_locked
202 . $this->_hidden
203 . __CLASS__
204 );
205 }
getSharedComponent()
Get the shared style component for the currently active cell in currently active sheet.
Definition: Protection.php:85

References getSharedComponent().

+ Here is the call graph for this function:

◆ getHidden()

PHPExcel_Style_Protection::getHidden ( )

Get hidden.

Returns
string

Definition at line 168 of file Protection.php.

168 {
169 if ($this->_isSupervisor) {
170 return $this->getSharedComponent()->getHidden();
171 }
172 return $this->_hidden;
173 }

References $_hidden, and getSharedComponent().

+ Here is the call graph for this function:

◆ getLocked()

PHPExcel_Style_Protection::getLocked ( )

Get locked.

Returns
string

Definition at line 140 of file Protection.php.

140 {
141 if ($this->_isSupervisor) {
142 return $this->getSharedComponent()->getLocked();
143 }
144 return $this->_locked;
145 }

References $_locked, and getSharedComponent().

+ Here is the call graph for this function:

◆ getSharedComponent()

PHPExcel_Style_Protection::getSharedComponent ( )

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

Only used for style supervisor

Returns
PHPExcel_Style_Protection

Definition at line 85 of file Protection.php.

86 {
87 return $this->_parent->getSharedComponent()->getProtection();
88 }

Referenced by getHashCode(), getHidden(), and getLocked().

+ Here is the caller graph for this function:

◆ getStyleArray()

PHPExcel_Style_Protection::getStyleArray (   $array)

Build style array from subcomponents.

Parameters
array$array
Returns
array

Definition at line 96 of file Protection.php.

97 {
98 return array('protection' => $array);
99 }

Referenced by applyFromArray(), setHidden(), and setLocked().

+ Here is the caller graph for this function:

◆ setHidden()

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

Set hidden.

Parameters
string$pValue
Returns
PHPExcel_Style_Protection

Definition at line 181 of file Protection.php.

181 {
182 if ($this->_isSupervisor) {
183 $styleArray = $this->getStyleArray(array('hidden' => $pValue));
184 $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
185 } else {
186 $this->_hidden = $pValue;
187 }
188 return $this;
189 }

References PHPExcel_Style_Supervisor\getActiveSheet(), PHPExcel_Style_Supervisor\getSelectedCells(), and getStyleArray().

Referenced by applyFromArray().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLocked()

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

Set locked.

Parameters
string$pValue
Returns
PHPExcel_Style_Protection

Definition at line 153 of file Protection.php.

153 {
154 if ($this->_isSupervisor) {
155 $styleArray = $this->getStyleArray(array('locked' => $pValue));
156 $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
157 } else {
158 $this->_locked = $pValue;
159 }
160 return $this;
161 }

References PHPExcel_Style_Supervisor\getActiveSheet(), PHPExcel_Style_Supervisor\getSelectedCells(), and getStyleArray().

Referenced by applyFromArray().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $_hidden

PHPExcel_Style_Protection::$_hidden
protected

Definition at line 55 of file Protection.php.

Referenced by getHidden().

◆ $_locked

PHPExcel_Style_Protection::$_locked
protected

Definition at line 48 of file Protection.php.

Referenced by getLocked().

◆ PROTECTION_INHERIT

◆ PROTECTION_PROTECTED

◆ PROTECTION_UNPROTECTED

const PHPExcel_Style_Protection::PROTECTION_UNPROTECTED = 'unprotected'

The documentation for this class was generated from the following file: