ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Style_Borders Class Reference
+ Inheritance diagram for PHPExcel_Style_Borders:
+ Collaboration diagram for PHPExcel_Style_Borders:

Public Member Functions

 __construct ($isSupervisor=false)
 Create a new PHPExcel_Style_Borders.
 bindParent ($parent)
 Bind parent.
 getIsSupervisor ()
 Is this a supervisor or a real style component?
 getSharedComponent ()
 Get the shared style component for the currently active cell in currently active sheet.
 getActiveSheet ()
 Get the currently active sheet.
 getSelectedCells ()
 Get the currently active cell coordinate in currently active sheet.
 getActiveCell ()
 Get the currently active cell coordinate in currently active sheet.
 getStyleArray ($array)
 Build style array from subcomponents.
 applyFromArray ($pStyles=null)
 Apply styles from array.
 getLeft ()
 Get Left.
 getRight ()
 Get Right.
 getTop ()
 Get Top.
 getBottom ()
 Get Bottom.
 getDiagonal ()
 Get Diagonal.
 getAllBorders ()
 Get AllBorders (pseudo-border).
 getOutline ()
 Get Outline (pseudo-border).
 getInside ()
 Get Inside (pseudo-border).
 getVertical ()
 Get Vertical (pseudo-border).
 getHorizontal ()
 Get Horizontal (pseudo-border).
 getDiagonalDirection ()
 Get DiagonalDirection.
 setDiagonalDirection ($pValue=PHPExcel_Style_Borders::DIAGONAL_NONE)
 Set DiagonalDirection.
 getHashCode ()
 Get hash code.
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy.

Data Fields

const DIAGONAL_NONE = 0
const DIAGONAL_UP = 1
const DIAGONAL_DOWN = 2
const DIAGONAL_BOTH = 3

Private Attributes

 $_left
 $_right
 $_top
 $_bottom
 $_diagonal
 $_diagonalDirection
 $_allBorders
 $_outline
 $_inside
 $_vertical
 $_horizontal
 $_parentPropertyName
 $_isSupervisor
 $_parent

Detailed Description

Definition at line 36 of file Borders.php.

Constructor & Destructor Documentation

PHPExcel_Style_Borders::__construct (   $isSupervisor = false)

Create a new PHPExcel_Style_Borders.

Definition at line 145 of file Borders.php.

References DIAGONAL_NONE.

{
// Supervisor?
$this->_isSupervisor = $isSupervisor;
// Initialise values
$this->_left = new PHPExcel_Style_Border($isSupervisor);
$this->_right = new PHPExcel_Style_Border($isSupervisor);
$this->_top = new PHPExcel_Style_Border($isSupervisor);
$this->_bottom = new PHPExcel_Style_Border($isSupervisor);
$this->_diagonal = new PHPExcel_Style_Border($isSupervisor);
$this->_diagonalDirection = PHPExcel_Style_Borders::DIAGONAL_NONE;
// Specially for supervisor
if ($isSupervisor) {
// Initialize pseudo-borders
$this->_allBorders = new PHPExcel_Style_Border(true);
$this->_outline = new PHPExcel_Style_Border(true);
$this->_inside = new PHPExcel_Style_Border(true);
$this->_vertical = new PHPExcel_Style_Border(true);
$this->_horizontal = new PHPExcel_Style_Border(true);
// bind parent if we are a supervisor
$this->_left->bindParent($this, '_left');
$this->_right->bindParent($this, '_right');
$this->_top->bindParent($this, '_top');
$this->_bottom->bindParent($this, '_bottom');
$this->_diagonal->bindParent($this, '_diagonal');
$this->_allBorders->bindParent($this, '_allBorders');
$this->_outline->bindParent($this, '_outline');
$this->_inside->bindParent($this, '_inside');
$this->_vertical->bindParent($this, '_vertical');
$this->_horizontal->bindParent($this, '_horizontal');
}
}

Member Function Documentation

PHPExcel_Style_Borders::__clone ( )

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

Definition at line 495 of file Borders.php.

{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if ((is_object($value)) && ($key != '_parent')) {
$this->$key = clone $value;
} else {
$this->$key = $value;
}
}
}
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
Exception
Returns
PHPExcel_Style_Borders

Definition at line 295 of file Borders.php.

References getActiveSheet(), getBottom(), getDiagonal(), getLeft(), getRight(), getSelectedCells(), getStyleArray(), getTop(), and setDiagonalDirection().

{
if (is_array($pStyles)) {
if ($this->_isSupervisor) {
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
} else {
if (array_key_exists('left', $pStyles)) {
$this->getLeft()->applyFromArray($pStyles['left']);
}
if (array_key_exists('right', $pStyles)) {
$this->getRight()->applyFromArray($pStyles['right']);
}
if (array_key_exists('top', $pStyles)) {
$this->getTop()->applyFromArray($pStyles['top']);
}
if (array_key_exists('bottom', $pStyles)) {
$this->getBottom()->applyFromArray($pStyles['bottom']);
}
if (array_key_exists('diagonal', $pStyles)) {
$this->getDiagonal()->applyFromArray($pStyles['diagonal']);
}
if (array_key_exists('diagonaldirection', $pStyles)) {
$this->setDiagonalDirection($pStyles['diagonaldirection']);
}
if (array_key_exists('allborders', $pStyles)) {
$this->getLeft()->applyFromArray($pStyles['allborders']);
$this->getRight()->applyFromArray($pStyles['allborders']);
$this->getTop()->applyFromArray($pStyles['allborders']);
$this->getBottom()->applyFromArray($pStyles['allborders']);
}
}
} else {
throw new Exception("Invalid style array passed.");
}
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Style_Borders::bindParent (   $parent)

Bind parent.

Only used for supervisor

Parameters
PHPExcel_Style$parent
Returns
PHPExcel_Style_Borders

Definition at line 187 of file Borders.php.

{
$this->_parent = $parent;
return $this;
}
PHPExcel_Style_Borders::getActiveCell ( )

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns
string E.g. 'A1'

Definition at line 241 of file Borders.php.

References getActiveSheet().

{
return $this->getActiveSheet()->getActiveCell();
}

+ Here is the call graph for this function:

PHPExcel_Style_Borders::getActiveSheet ( )

Get the currently active sheet.

Only used for supervisor

Returns
PHPExcel_Worksheet

Definition at line 219 of file Borders.php.

Referenced by applyFromArray(), getActiveCell(), getSelectedCells(), and setDiagonalDirection().

{
return $this->_parent->getActiveSheet();
}

+ Here is the caller graph for this function:

PHPExcel_Style_Borders::getAllBorders ( )

Get AllBorders (pseudo-border).

Only applies to supervisor.

Returns
PHPExcel_Style_Border
Exceptions
Exception

Definition at line 382 of file Borders.php.

References $_allBorders.

{
if (!$this->_isSupervisor) {
throw new Exception('Can only get pseudo-border for supervisor.');
}
}
PHPExcel_Style_Borders::getBottom ( )

Get Bottom.

Returns
PHPExcel_Style_Border

Definition at line 363 of file Borders.php.

References $_bottom.

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

{
}

+ Here is the caller graph for this function:

PHPExcel_Style_Borders::getDiagonal ( )

Get Diagonal.

Returns
PHPExcel_Style_Border

Definition at line 372 of file Borders.php.

References $_diagonal.

Referenced by applyFromArray(), and getHashCode().

{
}

+ Here is the caller graph for this function:

PHPExcel_Style_Borders::getDiagonalDirection ( )

Get DiagonalDirection.

Returns
int

Definition at line 446 of file Borders.php.

References $_diagonalDirection, and getSharedComponent().

Referenced by getHashCode().

{
if ($this->_isSupervisor) {
return $this->getSharedComponent()->getDiagonalDirection();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Style_Borders::getHashCode ( )

Get hash code.

Returns
string Hash code

Implements PHPExcel_IComparable.

Definition at line 477 of file Borders.php.

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

{
if ($this->_isSupervisor) {
return $this->getSharedComponent()->getHashcode();
}
return md5(
$this->getLeft()->getHashCode()
. $this->getRight()->getHashCode()
. $this->getTop()->getHashCode()
. $this->getBottom()->getHashCode()
. $this->getDiagonal()->getHashCode()
. __CLASS__
);
}

+ Here is the call graph for this function:

PHPExcel_Style_Borders::getHorizontal ( )

Get Horizontal (pseudo-border).

Only applies to supervisor.

Returns
PHPExcel_Style_Border
Exceptions
Exception

Definition at line 434 of file Borders.php.

References $_horizontal.

{
if (!$this->_isSupervisor) {
throw new Exception('Can only get pseudo-border for supervisor.');
}
}
PHPExcel_Style_Borders::getInside ( )

Get Inside (pseudo-border).

Only applies to supervisor.

Returns
boolean
Exceptions
Exception

Definition at line 408 of file Borders.php.

References $_inside.

{
if (!$this->_isSupervisor) {
throw new Exception('Can only get pseudo-border for supervisor.');
}
}
PHPExcel_Style_Borders::getIsSupervisor ( )

Is this a supervisor or a real style component?

Returns
boolean

Definition at line 198 of file Borders.php.

References $_isSupervisor.

{
}
PHPExcel_Style_Borders::getLeft ( )

Get Left.

Returns
PHPExcel_Style_Border

Definition at line 336 of file Borders.php.

References $_left.

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

{
return $this->_left;
}

+ Here is the caller graph for this function:

PHPExcel_Style_Borders::getOutline ( )

Get Outline (pseudo-border).

Only applies to supervisor.

Returns
boolean
Exceptions
Exception

Definition at line 395 of file Borders.php.

References $_outline.

{
if (!$this->_isSupervisor) {
throw new Exception('Can only get pseudo-border for supervisor.');
}
}
PHPExcel_Style_Borders::getRight ( )

Get Right.

Returns
PHPExcel_Style_Border

Definition at line 345 of file Borders.php.

References $_right.

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

{
return $this->_right;
}

+ Here is the caller graph for this function:

PHPExcel_Style_Borders::getSelectedCells ( )

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns
string E.g. 'A1'

Definition at line 230 of file Borders.php.

References getActiveSheet().

Referenced by applyFromArray(), and setDiagonalDirection().

{
return $this->getActiveSheet()->getSelectedCells();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Referenced by getDiagonalDirection(), and getHashCode().

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

+ Here is the caller graph for this function:

PHPExcel_Style_Borders::getStyleArray (   $array)

Build style array from subcomponents.

Parameters
array$array
Returns
array

Definition at line 252 of file Borders.php.

Referenced by applyFromArray(), and setDiagonalDirection().

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

+ Here is the caller graph for this function:

PHPExcel_Style_Borders::getTop ( )

Get Top.

Returns
PHPExcel_Style_Border

Definition at line 354 of file Borders.php.

References $_top.

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

{
return $this->_top;
}

+ Here is the caller graph for this function:

PHPExcel_Style_Borders::getVertical ( )

Get Vertical (pseudo-border).

Only applies to supervisor.

Returns
PHPExcel_Style_Border
Exceptions
Exception

Definition at line 421 of file Borders.php.

References $_vertical.

{
if (!$this->_isSupervisor) {
throw new Exception('Can only get pseudo-border for supervisor.');
}
}
PHPExcel_Style_Borders::setDiagonalDirection (   $pValue = PHPExcel_Style_Borders::DIAGONAL_NONE)

Set DiagonalDirection.

Parameters
int$pValue
Returns
PHPExcel_Style_Borders

Definition at line 459 of file Borders.php.

References DIAGONAL_NONE, getActiveSheet(), getSelectedCells(), and getStyleArray().

Referenced by applyFromArray().

{
if ($pValue == '') {
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('diagonaldirection' => $pValue));
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_diagonalDirection = $pValue;
}
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

PHPExcel_Style_Borders::$_allBorders
private

Definition at line 91 of file Borders.php.

Referenced by getAllBorders().

PHPExcel_Style_Borders::$_bottom
private

Definition at line 70 of file Borders.php.

Referenced by getBottom().

PHPExcel_Style_Borders::$_diagonal
private

Definition at line 77 of file Borders.php.

Referenced by getDiagonal().

PHPExcel_Style_Borders::$_diagonalDirection
private

Definition at line 84 of file Borders.php.

Referenced by getDiagonalDirection().

PHPExcel_Style_Borders::$_horizontal
private

Definition at line 119 of file Borders.php.

Referenced by getHorizontal().

PHPExcel_Style_Borders::$_inside
private

Definition at line 105 of file Borders.php.

Referenced by getInside().

PHPExcel_Style_Borders::$_isSupervisor
private

Definition at line 133 of file Borders.php.

Referenced by getIsSupervisor().

PHPExcel_Style_Borders::$_left
private

Definition at line 49 of file Borders.php.

Referenced by getLeft().

PHPExcel_Style_Borders::$_outline
private

Definition at line 98 of file Borders.php.

Referenced by getOutline().

PHPExcel_Style_Borders::$_parent
private

Definition at line 140 of file Borders.php.

PHPExcel_Style_Borders::$_parentPropertyName
private

Definition at line 126 of file Borders.php.

PHPExcel_Style_Borders::$_right
private

Definition at line 56 of file Borders.php.

Referenced by getRight().

PHPExcel_Style_Borders::$_top
private

Definition at line 63 of file Borders.php.

Referenced by getTop().

PHPExcel_Style_Borders::$_vertical
private

Definition at line 112 of file Borders.php.

Referenced by getVertical().

const PHPExcel_Style_Borders::DIAGONAL_NONE = 0

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