ILIAS  Release_4_0_x_branch Revision 61816
 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.
 getXSelectedCells ()
 Get the currently active cell coordinate in currently active sheet.
 getXActiveCell ()
 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.
 getHashIndex ()
 Get hash index.
 setHashIndex ($value)
 Set hash index.
 __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

Private Attributes

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

Detailed Description

Definition at line 51 of file Borders.php.

Constructor & Destructor Documentation

PHPExcel_Style_Borders::__construct (   $isSupervisor = false)

Create a new PHPExcel_Style_Borders.

Definition at line 159 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 534 of file Borders.php.

References $key.

{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (is_object($value)) {
$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 309 of file Borders.php.

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

{
if (is_array($pStyles)) {
if ($this->_isSupervisor) {
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->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']);
}
}
} 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 201 of file Borders.php.

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

Get the currently active sheet.

Only used for supervisor

Returns
PHPExcel_Worksheet

Definition at line 233 of file Borders.php.

Referenced by applyFromArray(), getXActiveCell(), getXSelectedCells(), 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 390 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 371 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 380 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 454 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 485 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::getHashIndex ( )

Get hash index.

Note that this index may vary during script execution! Only reliable moment is while doing a write of a workbook and when changes are not allowed.

Returns
string Hash index

Implements PHPExcel_IComparable.

Definition at line 515 of file Borders.php.

References $_hashIndex.

{
}
PHPExcel_Style_Borders::getHorizontal ( )

Get Horizontal (pseudo-border).

Only applies to supervisor.

Returns
PHPExcel_Style_Border
Exceptions
Exception

Definition at line 442 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 416 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 212 of file Borders.php.

References $_isSupervisor.

{
}
PHPExcel_Style_Borders::getLeft ( )

Get Left.

Returns
PHPExcel_Style_Border

Definition at line 344 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 403 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 353 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::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 223 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 266 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 362 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 429 of file Borders.php.

References $_vertical.

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

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns
string E.g. 'A1'

Definition at line 255 of file Borders.php.

References getActiveSheet().

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

+ Here is the call graph for this function:

PHPExcel_Style_Borders::getXSelectedCells ( )

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns
string E.g. 'A1'

Definition at line 244 of file Borders.php.

References getActiveSheet().

Referenced by applyFromArray(), and setDiagonalDirection().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Set DiagonalDirection.

Parameters
int$pValue
Returns
PHPExcel_Style_Borders

Definition at line 467 of file Borders.php.

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

Referenced by applyFromArray().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Style_Borders::setHashIndex (   $value)

Set hash index.

Note that this index may vary during script execution! Only reliable moment is while doing a write of a workbook and when changes are not allowed.

Parameters
string$valueHash index

Implements PHPExcel_IComparable.

Definition at line 527 of file Borders.php.

{
$this->_hashIndex = $value;
}

Field Documentation

PHPExcel_Style_Borders::$_allBorders
private

Definition at line 105 of file Borders.php.

Referenced by getAllBorders().

PHPExcel_Style_Borders::$_bottom
private

Definition at line 84 of file Borders.php.

Referenced by getBottom().

PHPExcel_Style_Borders::$_diagonal
private

Definition at line 91 of file Borders.php.

Referenced by getDiagonal().

PHPExcel_Style_Borders::$_diagonalDirection
private

Definition at line 98 of file Borders.php.

Referenced by getDiagonalDirection().

PHPExcel_Style_Borders::$_hashIndex
private

Definition at line 505 of file Borders.php.

Referenced by getHashIndex().

PHPExcel_Style_Borders::$_horizontal
private

Definition at line 133 of file Borders.php.

Referenced by getHorizontal().

PHPExcel_Style_Borders::$_inside
private

Definition at line 119 of file Borders.php.

Referenced by getInside().

PHPExcel_Style_Borders::$_isSupervisor
private

Definition at line 147 of file Borders.php.

Referenced by getIsSupervisor().

PHPExcel_Style_Borders::$_left
private

Definition at line 63 of file Borders.php.

Referenced by getLeft().

PHPExcel_Style_Borders::$_outline
private

Definition at line 112 of file Borders.php.

Referenced by getOutline().

PHPExcel_Style_Borders::$_parent
private

Definition at line 154 of file Borders.php.

PHPExcel_Style_Borders::$_parentPropertyName
private

Definition at line 140 of file Borders.php.

PHPExcel_Style_Borders::$_right
private

Definition at line 70 of file Borders.php.

Referenced by getRight().

PHPExcel_Style_Borders::$_top
private

Definition at line 77 of file Borders.php.

Referenced by getTop().

PHPExcel_Style_Borders::$_vertical
private

Definition at line 126 of file Borders.php.

Referenced by getVertical().

const PHPExcel_Style_Borders::DIAGONAL_DOWN = 2
const PHPExcel_Style_Borders::DIAGONAL_NONE = 0

Definition at line 54 of file Borders.php.

Referenced by __construct(), and setDiagonalDirection().

const PHPExcel_Style_Borders::DIAGONAL_UP = 1

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