ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Style_Border Class Reference
+ Inheritance diagram for PHPExcel_Style_Border:
+ Collaboration diagram for PHPExcel_Style_Border:

Public Member Functions

 __construct ($isSupervisor=false)
 Create a new PHPExcel_Style_Border.
 bindParent ($parent, $parentPropertyName)
 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.
 getBorderStyle ()
 Get Border style.
 setBorderStyle ($pValue=PHPExcel_Style_Border::BORDER_NONE)
 Set Border style.
 getColor ()
 Get Border Color.
 setColor (PHPExcel_Style_Color $pValue=null)
 Set Border Color.
 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 BORDER_NONE = 'none'
const BORDER_DASHDOT = 'dashDot'
const BORDER_DASHDOTDOT = 'dashDotDot'
const BORDER_DASHED = 'dashed'
const BORDER_DOTTED = 'dotted'
const BORDER_DOUBLE = 'double'
const BORDER_HAIR = 'hair'
const BORDER_MEDIUM = 'medium'
const BORDER_MEDIUMDASHDOT = 'mediumDashDot'
const BORDER_MEDIUMDASHDOTDOT = 'mediumDashDotDot'
const BORDER_MEDIUMDASHED = 'mediumDashed'
const BORDER_SLANTDASHDOT = 'slantDashDot'
const BORDER_THICK = 'thick'
const BORDER_THIN = 'thin'

Private Attributes

 $_borderStyle
 $_color
 $_isSupervisor
 $_parent
 $_parentPropertyName
 $_hashIndex

Detailed Description

Definition at line 51 of file Border.php.

Constructor & Destructor Documentation

PHPExcel_Style_Border::__construct (   $isSupervisor = false)

Create a new PHPExcel_Style_Border.

Definition at line 107 of file Border.php.

References BORDER_NONE, and PHPExcel_Style_Color\COLOR_BLACK.

{
// Supervisor?
$this->_isSupervisor = $isSupervisor;
// Initialise values
$this->_borderStyle = PHPExcel_Style_Border::BORDER_NONE;
$this->_color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor);
// bind parent if we are a supervisor
if ($isSupervisor) {
$this->_color->bindParent($this, '_color');
}
}

Member Function Documentation

PHPExcel_Style_Border::__clone ( )

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

Definition at line 418 of file Border.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_Border::applyFromArray (   $pStyles = null)

Apply styles from array.

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

Parameters
array$pStylesArray containing style information
Exceptions
Exception
Returns
PHPExcel_Style_Border

Definition at line 289 of file Border.php.

References getActiveSheet(), getColor(), getStyleArray(), getXSelectedCells(), and setBorderStyle().

{
if (is_array($pStyles)) {
if ($this->_isSupervisor) {
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
} else {
if (array_key_exists('style', $pStyles)) {
$this->setBorderStyle($pStyles['style']);
}
if (array_key_exists('color', $pStyles)) {
$this->getColor()->applyFromArray($pStyles['color']);
}
}
} else {
throw new Exception("Invalid style array passed.");
}
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Style_Border::bindParent (   $parent,
  $parentPropertyName 
)

Bind parent.

Only used for supervisor

Parameters
PHPExcel_Style_Borders$parent
string$parentPropertyName
Returns
PHPExcel_Style_Border

Definition at line 129 of file Border.php.

{
$this->_parent = $parent;
$this->_parentPropertyName = $parentPropertyName;
return $this;
}
PHPExcel_Style_Border::getActiveSheet ( )

Get the currently active sheet.

Only used for supervisor

Returns
PHPExcel_Worksheet

Definition at line 192 of file Border.php.

Referenced by applyFromArray(), getXActiveCell(), getXSelectedCells(), setBorderStyle(), and setColor().

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

+ Here is the caller graph for this function:

PHPExcel_Style_Border::getBorderStyle ( )

Get Border style.

Returns
string

Definition at line 312 of file Border.php.

References $_borderStyle, and getSharedComponent().

Referenced by PHPExcel_Writer_HTML\_createCSSStyleBorder().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Style_Border::getColor ( )

Get Border Color.

Returns
PHPExcel_Style_Color

Definition at line 344 of file Border.php.

References $_color.

Referenced by PHPExcel_Writer_HTML\_createCSSStyleBorder(), applyFromArray(), and setColor().

{
return $this->_color;
}

+ Here is the caller graph for this function:

PHPExcel_Style_Border::getHashCode ( )

Get hash code.

Returns
string Hash code

Implements PHPExcel_IComparable.

Definition at line 373 of file Border.php.

References getSharedComponent().

{
if ($this->_isSupervisor) {
return $this->getSharedComponent()->getHashCode();
}
return md5(
$this->_borderStyle
. $this->_color->getHashCode()
. __CLASS__
);
}

+ Here is the call graph for this function:

PHPExcel_Style_Border::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 399 of file Border.php.

References $_hashIndex.

{
}
PHPExcel_Style_Border::getIsSupervisor ( )

Is this a supervisor or a real style component?

Returns
boolean

Definition at line 141 of file Border.php.

References $_isSupervisor.

{
}
PHPExcel_Style_Border::getSharedComponent ( )

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

Only used for style supervisor

Returns
PHPExcel_Style_Border
Exceptions
Exception

Definition at line 153 of file Border.php.

Referenced by getBorderStyle(), and getHashCode().

{
switch ($this->_parentPropertyName) {
case '_allBorders':
case '_horizontal':
case '_inside':
case '_outline':
case '_vertical':
throw new Exception('Cannot get shared component for a pseudo-border.');
break;
case '_bottom':
return $this->_parent->getSharedComponent()->getBottom();
break;
case '_diagonal':
return $this->_parent->getSharedComponent()->getDiagonal();
break;
case '_left':
return $this->_parent->getSharedComponent()->getLeft();
break;
case '_right':
return $this->_parent->getSharedComponent()->getRight();
break;
case '_top':
return $this->_parent->getSharedComponent()->getTop();
break;
}
}

+ Here is the caller graph for this function:

PHPExcel_Style_Border::getStyleArray (   $array)

Build style array from subcomponents.

Parameters
array$array
Returns
array

Definition at line 225 of file Border.php.

References $key.

Referenced by applyFromArray(), and setBorderStyle().

{
switch ($this->_parentPropertyName) {
case '_allBorders':
$key = 'allborders';
break;
case '_bottom':
$key = 'bottom';
break;
case '_diagonal':
$key = 'diagonal';
break;
case '_horizontal':
$key = 'horizontal';
break;
case '_inside':
$key = 'inside';
break;
case '_left':
$key = 'left';
break;
case '_outline':
$key = 'outline';
break;
case '_right':
$key = 'right';
break;
case '_top':
$key = 'top';
break;
case '_vertical':
$key = 'vertical';
break;
}
return $this->_parent->getStyleArray(array($key => $array));
}

+ Here is the caller graph for this function:

PHPExcel_Style_Border::getXActiveCell ( )

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns
string E.g. 'A1'

Definition at line 214 of file Border.php.

References getActiveSheet().

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

+ Here is the call graph for this function:

PHPExcel_Style_Border::getXSelectedCells ( )

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns
string E.g. 'A1'

Definition at line 203 of file Border.php.

References getActiveSheet().

Referenced by applyFromArray(), setBorderStyle(), and setColor().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Style_Border::setBorderStyle (   $pValue = PHPExcel_Style_Border::BORDER_NONE)

Set Border style.

Parameters
string$pValue
Returns
PHPExcel_Style_Border

Definition at line 325 of file Border.php.

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

Referenced by applyFromArray().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Style_Border::setColor ( PHPExcel_Style_Color  $pValue = null)

Set Border Color.

Parameters
PHPExcel_Style_Color$pValue
Exceptions
Exception
Returns
PHPExcel_Style_Border

Definition at line 355 of file Border.php.

References getActiveSheet(), getColor(), and getXSelectedCells().

{
// make sure parameter is a real color and not a supervisor
$color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
if ($this->_isSupervisor) {
$styleArray = $this->getColor()->getStyleArray(array('argb' => $color->getARGB()));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
} else {
$this->_color = $color;
}
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Style_Border::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 411 of file Border.php.

{
$this->_hashIndex = $value;
}

Field Documentation

PHPExcel_Style_Border::$_borderStyle
private

Definition at line 74 of file Border.php.

Referenced by getBorderStyle().

PHPExcel_Style_Border::$_color
private

Definition at line 81 of file Border.php.

Referenced by getColor().

PHPExcel_Style_Border::$_hashIndex
private

Definition at line 389 of file Border.php.

Referenced by getHashIndex().

PHPExcel_Style_Border::$_isSupervisor
private

Definition at line 88 of file Border.php.

Referenced by getIsSupervisor().

PHPExcel_Style_Border::$_parent
private

Definition at line 95 of file Border.php.

PHPExcel_Style_Border::$_parentPropertyName
private

Definition at line 102 of file Border.php.

const PHPExcel_Style_Border::BORDER_DASHDOT = 'dashDot'
const PHPExcel_Style_Border::BORDER_DASHDOTDOT = 'dashDotDot'
const PHPExcel_Style_Border::BORDER_DASHED = 'dashed'
const PHPExcel_Style_Border::BORDER_DOTTED = 'dotted'
const PHPExcel_Style_Border::BORDER_DOUBLE = 'double'
const PHPExcel_Style_Border::BORDER_HAIR = 'hair'
const PHPExcel_Style_Border::BORDER_MEDIUM = 'medium'
const PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT = 'mediumDashDot'
const PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT = 'mediumDashDotDot'
const PHPExcel_Style_Border::BORDER_MEDIUMDASHED = 'mediumDashed'
const PHPExcel_Style_Border::BORDER_SLANTDASHDOT = 'slantDashDot'
const PHPExcel_Style_Border::BORDER_THICK = 'thick'
const PHPExcel_Style_Border::BORDER_THIN = 'thin'

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