ILIAS  eassessment Revision 61809
 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.
 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.
 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.
 __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 = PHPExcel_Style_Border::BORDER_NONE
 $_color
 $_isSupervisor
 $_parent
 $_parentPropertyName

Detailed Description

Definition at line 36 of file Border.php.

Constructor & Destructor Documentation

PHPExcel_Style_Border::__construct (   $isSupervisor = false)

Create a new PHPExcel_Style_Border.

Definition at line 92 of file Border.php.

References PHPExcel_Style_Color\COLOR_BLACK.

{
// Supervisor?
$this->_isSupervisor = $isSupervisor;
// Initialise values
$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 371 of file Border.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_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 273 of file Border.php.

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

{
if (is_array($pStyles)) {
if ($this->_isSupervisor) {
$this->getActiveSheet()->getStyle($this->getSelectedCells())->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 113 of file Border.php.

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

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns
string E.g. 'A1'

Definition at line 198 of file Border.php.

References getActiveSheet().

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

+ Here is the call graph for this function:

PHPExcel_Style_Border::getActiveSheet ( )

Get the currently active sheet.

Only used for supervisor

Returns
PHPExcel_Worksheet

Definition at line 176 of file Border.php.

Referenced by applyFromArray(), getActiveCell(), getSelectedCells(), 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 296 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 328 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 357 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::getIsSupervisor ( )

Is this a supervisor or a real style component?

Returns
boolean

Definition at line 125 of file Border.php.

References $_isSupervisor.

{
}
PHPExcel_Style_Border::getSelectedCells ( )

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns
string E.g. 'A1'

Definition at line 187 of file Border.php.

References getActiveSheet().

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

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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::setBorderStyle (   $pValue = PHPExcel_Style_Border::BORDER_NONE)

Set Border style.

Parameters
string$pValue
Returns
PHPExcel_Style_Border

Definition at line 309 of file Border.php.

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

Referenced by applyFromArray().

{
if ($pValue == '') {
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('style' => $pValue));
$this->getActiveSheet()->getStyle($this->getSelectedCells())->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 339 of file Border.php.

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

{
// 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->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_color = $color;
}
return $this;
}

+ Here is the call graph for this function:

Field Documentation

PHPExcel_Style_Border::$_borderStyle = PHPExcel_Style_Border::BORDER_NONE
private

Definition at line 59 of file Border.php.

Referenced by getBorderStyle().

PHPExcel_Style_Border::$_color
private

Definition at line 66 of file Border.php.

Referenced by getColor().

PHPExcel_Style_Border::$_isSupervisor
private

Definition at line 73 of file Border.php.

Referenced by getIsSupervisor().

PHPExcel_Style_Border::$_parent
private

Definition at line 80 of file Border.php.

PHPExcel_Style_Border::$_parentPropertyName
private

Definition at line 87 of file Border.php.

const PHPExcel_Style_Border::BORDER_HAIR = 'hair'
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'

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