ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
PHPExcel_Style_Borders Class Reference
+ Inheritance diagram for PHPExcel_Style_Borders:
+ Collaboration diagram for PHPExcel_Style_Borders:

Public Member Functions

 __construct ($isSupervisor=FALSE, $isConditional=FALSE)
 Create a new PHPExcel_Style_Borders. 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...
 
 getLeft ()
 Get Left. More...
 
 getRight ()
 Get Right. More...
 
 getTop ()
 Get Top. More...
 
 getBottom ()
 Get Bottom. More...
 
 getDiagonal ()
 Get Diagonal. More...
 
 getAllBorders ()
 Get AllBorders (pseudo-border). More...
 
 getOutline ()
 Get Outline (pseudo-border). More...
 
 getInside ()
 Get Inside (pseudo-border). More...
 
 getVertical ()
 Get Vertical (pseudo-border). More...
 
 getHorizontal ()
 Get Horizontal (pseudo-border). More...
 
 getDiagonalDirection ()
 Get DiagonalDirection. More...
 
 setDiagonalDirection ($pValue=PHPExcel_Style_Borders::DIAGONAL_NONE)
 Set DiagonalDirection. 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 DIAGONAL_NONE = 0
 
const DIAGONAL_UP = 1
 
const DIAGONAL_DOWN = 2
 
const DIAGONAL_BOTH = 3
 

Protected Attributes

 $_left
 
 $_right
 
 $_top
 
 $_bottom
 
 $_diagonal
 
 $_diagonalDirection
 
 $_allBorders
 
 $_outline
 
 $_inside
 
 $_vertical
 
 $_horizontal
 
- Protected Attributes inherited from PHPExcel_Style_Supervisor
 $_isSupervisor
 
 $_parent
 

Detailed Description

Definition at line 36 of file Borders.php.

Constructor & Destructor Documentation

◆ __construct()

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

Create a new PHPExcel_Style_Borders.

@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 131 of file Borders.php.

132 {
133 // Supervisor?
134 parent::__construct($isSupervisor);
135
136 // Initialise values
137 $this->_left = new PHPExcel_Style_Border($isSupervisor, $isConditional);
138 $this->_right = new PHPExcel_Style_Border($isSupervisor, $isConditional);
139 $this->_top = new PHPExcel_Style_Border($isSupervisor, $isConditional);
140 $this->_bottom = new PHPExcel_Style_Border($isSupervisor, $isConditional);
141 $this->_diagonal = new PHPExcel_Style_Border($isSupervisor, $isConditional);
142 $this->_diagonalDirection = PHPExcel_Style_Borders::DIAGONAL_NONE;
143
144 // Specially for supervisor
145 if ($isSupervisor) {
146 // Initialize pseudo-borders
147 $this->_allBorders = new PHPExcel_Style_Border(TRUE);
148 $this->_outline = new PHPExcel_Style_Border(TRUE);
149 $this->_inside = new PHPExcel_Style_Border(TRUE);
150 $this->_vertical = new PHPExcel_Style_Border(TRUE);
151 $this->_horizontal = new PHPExcel_Style_Border(TRUE);
152
153 // bind parent if we are a supervisor
154 $this->_left->bindParent($this, '_left');
155 $this->_right->bindParent($this, '_right');
156 $this->_top->bindParent($this, '_top');
157 $this->_bottom->bindParent($this, '_bottom');
158 $this->_diagonal->bindParent($this, '_diagonal');
159 $this->_allBorders->bindParent($this, '_allBorders');
160 $this->_outline->bindParent($this, '_outline');
161 $this->_inside->bindParent($this, '_inside');
162 $this->_vertical->bindParent($this, '_vertical');
163 $this->_horizontal->bindParent($this, '_horizontal');
164 }
165 }

References DIAGONAL_NONE.

Member Function Documentation

◆ applyFromArray()

PHPExcel_Style_Borders::applyFromArray (   $pStyles = null)

Apply styles from array.

$objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( array( 'bottom' => array( 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, 'color' => array( 'rgb' => '808080' ) ), 'top' => array( 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, 'color' => array( 'rgb' => '808080' ) ) ) ); $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( array( 'allborders' => array( 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, 'color' => array( 'rgb' => '808080' ) ) ) );

Parameters
array$pStylesArray containing style information
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Style_Borders

Definition at line 227 of file Borders.php.

227 {
228 if (is_array($pStyles)) {
229 if ($this->_isSupervisor) {
230 $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
231 } else {
232 if (array_key_exists('left', $pStyles)) {
233 $this->getLeft()->applyFromArray($pStyles['left']);
234 }
235 if (array_key_exists('right', $pStyles)) {
236 $this->getRight()->applyFromArray($pStyles['right']);
237 }
238 if (array_key_exists('top', $pStyles)) {
239 $this->getTop()->applyFromArray($pStyles['top']);
240 }
241 if (array_key_exists('bottom', $pStyles)) {
242 $this->getBottom()->applyFromArray($pStyles['bottom']);
243 }
244 if (array_key_exists('diagonal', $pStyles)) {
245 $this->getDiagonal()->applyFromArray($pStyles['diagonal']);
246 }
247 if (array_key_exists('diagonaldirection', $pStyles)) {
248 $this->setDiagonalDirection($pStyles['diagonaldirection']);
249 }
250 if (array_key_exists('allborders', $pStyles)) {
251 $this->getLeft()->applyFromArray($pStyles['allborders']);
252 $this->getRight()->applyFromArray($pStyles['allborders']);
253 $this->getTop()->applyFromArray($pStyles['allborders']);
254 $this->getBottom()->applyFromArray($pStyles['allborders']);
255 }
256 }
257 } else {
258 throw new PHPExcel_Exception("Invalid style array passed.");
259 }
260 return $this;
261 }
getLeft()
Get Left.
Definition: Borders.php:268
getBottom()
Get Bottom.
Definition: Borders.php:295
getStyleArray($array)
Build style array from subcomponents.
Definition: Borders.php:184
setDiagonalDirection($pValue=PHPExcel_Style_Borders::DIAGONAL_NONE)
Set DiagonalDirection.
Definition: Borders.php:391
getRight()
Get Right.
Definition: Borders.php:277
getDiagonal()
Get Diagonal.
Definition: Borders.php:304
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(), getBottom(), getDiagonal(), getLeft(), getRight(), PHPExcel_Style_Supervisor\getSelectedCells(), getStyleArray(), getTop(), and setDiagonalDirection().

+ Here is the call graph for this function:

◆ getAllBorders()

PHPExcel_Style_Borders::getAllBorders ( )

Get AllBorders (pseudo-border).

Only applies to supervisor.

Returns
PHPExcel_Style_Border
Exceptions
PHPExcel_Exception

Definition at line 314 of file Borders.php.

314 {
315 if (!$this->_isSupervisor) {
316 throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
317 }
318 return $this->_allBorders;
319 }

References $_allBorders.

◆ getBottom()

PHPExcel_Style_Borders::getBottom ( )

Get Bottom.

Returns
PHPExcel_Style_Border

Definition at line 295 of file Borders.php.

295 {
296 return $this->_bottom;
297 }

References $_bottom.

Referenced by PHPExcel_Writer_HTML\_createCSSStyleBorders(), applyFromArray(), and getHashCode().

+ Here is the caller graph for this function:

◆ getDiagonal()

PHPExcel_Style_Borders::getDiagonal ( )

Get Diagonal.

Returns
PHPExcel_Style_Border

Definition at line 304 of file Borders.php.

304 {
305 return $this->_diagonal;
306 }

References $_diagonal.

Referenced by applyFromArray(), and getHashCode().

+ Here is the caller graph for this function:

◆ getDiagonalDirection()

PHPExcel_Style_Borders::getDiagonalDirection ( )

Get DiagonalDirection.

Returns
int

Definition at line 378 of file Borders.php.

378 {
379 if ($this->_isSupervisor) {
380 return $this->getSharedComponent()->getDiagonalDirection();
381 }
383 }
getSharedComponent()
Get the shared style component for the currently active cell in currently active sheet.
Definition: Borders.php:173

References $_diagonalDirection, and getSharedComponent().

Referenced by getHashCode().

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

◆ getHashCode()

PHPExcel_Style_Borders::getHashCode ( )

Get hash code.

Returns
string Hash code

Implements PHPExcel_IComparable.

Definition at line 409 of file Borders.php.

409 {
410 if ($this->_isSupervisor) {
411 return $this->getSharedComponent()->getHashcode();
412 }
413 return md5(
414 $this->getLeft()->getHashCode()
415 . $this->getRight()->getHashCode()
416 . $this->getTop()->getHashCode()
417 . $this->getBottom()->getHashCode()
418 . $this->getDiagonal()->getHashCode()
419 . $this->getDiagonalDirection()
420 . __CLASS__
421 );
422 }
getDiagonalDirection()
Get DiagonalDirection.
Definition: Borders.php:378
getHashCode()
Get hash code.
Definition: Borders.php:409

References getBottom(), getDiagonal(), getDiagonalDirection(), getHashCode(), getLeft(), getRight(), getSharedComponent(), and getTop().

Referenced by getHashCode().

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

◆ getHorizontal()

PHPExcel_Style_Borders::getHorizontal ( )

Get Horizontal (pseudo-border).

Only applies to supervisor.

Returns
PHPExcel_Style_Border
Exceptions
PHPExcel_Exception

Definition at line 366 of file Borders.php.

366 {
367 if (!$this->_isSupervisor) {
368 throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
369 }
370 return $this->_horizontal;
371 }

References $_horizontal.

◆ getInside()

PHPExcel_Style_Borders::getInside ( )

Get Inside (pseudo-border).

Only applies to supervisor.

Returns
boolean
Exceptions
PHPExcel_Exception

Definition at line 340 of file Borders.php.

340 {
341 if (!$this->_isSupervisor) {
342 throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
343 }
344 return $this->_inside;
345 }

References $_inside.

◆ getLeft()

PHPExcel_Style_Borders::getLeft ( )

Get Left.

Returns
PHPExcel_Style_Border

Definition at line 268 of file Borders.php.

268 {
269 return $this->_left;
270 }

References $_left.

Referenced by PHPExcel_Writer_HTML\_createCSSStyleBorders(), applyFromArray(), and getHashCode().

+ Here is the caller graph for this function:

◆ getOutline()

PHPExcel_Style_Borders::getOutline ( )

Get Outline (pseudo-border).

Only applies to supervisor.

Returns
boolean
Exceptions
PHPExcel_Exception

Definition at line 327 of file Borders.php.

327 {
328 if (!$this->_isSupervisor) {
329 throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
330 }
331 return $this->_outline;
332 }

References $_outline.

◆ getRight()

PHPExcel_Style_Borders::getRight ( )

Get Right.

Returns
PHPExcel_Style_Border

Definition at line 277 of file Borders.php.

277 {
278 return $this->_right;
279 }

References $_right.

Referenced by PHPExcel_Writer_HTML\_createCSSStyleBorders(), applyFromArray(), and getHashCode().

+ Here is the caller graph for this function:

◆ getSharedComponent()

PHPExcel_Style_Borders::getSharedComponent ( )

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

Only used for style supervisor

Returns
PHPExcel_Style_Borders

Definition at line 173 of file Borders.php.

174 {
175 return $this->_parent->getSharedComponent()->getBorders();
176 }

Referenced by getDiagonalDirection(), and getHashCode().

+ Here is the caller graph for this function:

◆ getStyleArray()

PHPExcel_Style_Borders::getStyleArray (   $array)

Build style array from subcomponents.

Parameters
array$array
Returns
array

Definition at line 184 of file Borders.php.

185 {
186 return array('borders' => $array);
187 }

Referenced by applyFromArray(), and setDiagonalDirection().

+ Here is the caller graph for this function:

◆ getTop()

PHPExcel_Style_Borders::getTop ( )

Get Top.

Returns
PHPExcel_Style_Border

Definition at line 286 of file Borders.php.

286 {
287 return $this->_top;
288 }

References $_top.

Referenced by PHPExcel_Writer_HTML\_createCSSStyleBorders(), applyFromArray(), and getHashCode().

+ Here is the caller graph for this function:

◆ getVertical()

PHPExcel_Style_Borders::getVertical ( )

Get Vertical (pseudo-border).

Only applies to supervisor.

Returns
PHPExcel_Style_Border
Exceptions
PHPExcel_Exception

Definition at line 353 of file Borders.php.

353 {
354 if (!$this->_isSupervisor) {
355 throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
356 }
357 return $this->_vertical;
358 }

References $_vertical.

◆ setDiagonalDirection()

PHPExcel_Style_Borders::setDiagonalDirection (   $pValue = PHPExcel_Style_Borders::DIAGONAL_NONE)

Set DiagonalDirection.

Parameters
int$pValue
Returns
PHPExcel_Style_Borders

Definition at line 391 of file Borders.php.

391 {
392 if ($pValue == '') {
394 }
395 if ($this->_isSupervisor) {
396 $styleArray = $this->getStyleArray(array('diagonaldirection' => $pValue));
397 $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
398 } else {
399 $this->_diagonalDirection = $pValue;
400 }
401 return $this;
402 }

References DIAGONAL_NONE, 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

◆ $_allBorders

PHPExcel_Style_Borders::$_allBorders
protected

Definition at line 91 of file Borders.php.

Referenced by getAllBorders().

◆ $_bottom

PHPExcel_Style_Borders::$_bottom
protected

Definition at line 70 of file Borders.php.

Referenced by getBottom().

◆ $_diagonal

PHPExcel_Style_Borders::$_diagonal
protected

Definition at line 77 of file Borders.php.

Referenced by getDiagonal().

◆ $_diagonalDirection

PHPExcel_Style_Borders::$_diagonalDirection
protected

Definition at line 84 of file Borders.php.

Referenced by getDiagonalDirection().

◆ $_horizontal

PHPExcel_Style_Borders::$_horizontal
protected

Definition at line 119 of file Borders.php.

Referenced by getHorizontal().

◆ $_inside

PHPExcel_Style_Borders::$_inside
protected

Definition at line 105 of file Borders.php.

Referenced by getInside().

◆ $_left

PHPExcel_Style_Borders::$_left
protected

Definition at line 49 of file Borders.php.

Referenced by getLeft().

◆ $_outline

PHPExcel_Style_Borders::$_outline
protected

Definition at line 98 of file Borders.php.

Referenced by getOutline().

◆ $_right

PHPExcel_Style_Borders::$_right
protected

Definition at line 56 of file Borders.php.

Referenced by getRight().

◆ $_top

PHPExcel_Style_Borders::$_top
protected

Definition at line 63 of file Borders.php.

Referenced by getTop().

◆ $_vertical

PHPExcel_Style_Borders::$_vertical
protected

Definition at line 112 of file Borders.php.

Referenced by getVertical().

◆ DIAGONAL_BOTH

◆ DIAGONAL_DOWN

◆ DIAGONAL_NONE

const PHPExcel_Style_Borders::DIAGONAL_NONE = 0

◆ DIAGONAL_UP


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