Source for file Borders.php
Documentation is available at Borders.php
* Copyright (c) 2006 - 2009 PHPExcel
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.6.5, 2009-01-05
/** PHPExcel_Style_Border */
require_once 'PHPExcel/Style/Border.php';
/** PHPExcel_IComparable */
require_once 'PHPExcel/IComparable.php';
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
/* Diagonal directions */
* @var PHPExcel_Style_Border
* @var PHPExcel_Style_Border
* @var PHPExcel_Style_Border
* @var PHPExcel_Style_Border
* @var PHPExcel_Style_Border
* @var PHPExcel_Style_Border
* @var PHPExcel_Style_Border
* Outline, defaults to true
* @var _parentPropertyName string
* Create a new PHPExcel_Style_Borders
* The following properties are late bound. Binding is initiated by property classes when they are modified.
* Configures this object for late binding as a property of a parent object
* @param $parentPropertyName
// Initialize parent PHPExcel_Style for late binding. This relationship purposely ends immediately when this object
// is bound to the PHPExcel_Style object pointed to so as to prevent circular references.
* Returns the PHPExcel_Style_Borders that is actual bound to PHPExcel_Style
* @return PHPExcel_Style_Borders
return $this; // I am bound
return $this; // No one is bound yet
* If no PHPExcel_Style_Borders has been bound to PHPExcel_Style then bind this one. Return the actual bound one.
* @return PHPExcel_Style_Borders
return $this; // I am already bound
* Complete the binding process a child property object started
* @param $propertyName Name of this property in the parent object
throw new Exception("Invalid property passed.");
* Determines if a child property is bound to this one
* @param $propertyName Name of this property in the parent object
throw new Exception("Invalid property passed.");
* Apply styles from array
* $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
* 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
* 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
* $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
* 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
* @param array $pStyles Array containing style information
$this->getLeft()->applyFromArray($pStyles['allborders']);
$this->getRight()->applyFromArray($pStyles['allborders']);
$this->getTop()->applyFromArray($pStyles['allborders']);
$this->getBottom()->applyFromArray($pStyles['allborders']);
$this->getLeft()->applyFromArray($pStyles['left']);
$this->getRight()->applyFromArray($pStyles['right']);
$this->getTop()->applyFromArray($pStyles['top']);
$this->getBottom()->applyFromArray($pStyles['bottom']);
$this->getDiagonal()->applyFromArray($pStyles['diagonal']);
$this->getVertical()->applyFromArray($pStyles['vertical']);
throw new Exception("Invalid style array passed.");
* @return PHPExcel_Style_Border
if(isset ($property->_left))
$property->propertyPrepareBind($this, "_left");
* @return PHPExcel_Style_Border
if(isset ($property->_right))
return $property->_right;
$property->propertyPrepareBind($this, "_right");
* @return PHPExcel_Style_Border
if(isset ($property->_top))
$property->propertyPrepareBind($this, "_top");
* @return PHPExcel_Style_Border
if(isset ($property->_bottom))
return $property->_bottom;
$property->propertyPrepareBind($this, "_bottom");
* @return PHPExcel_Style_Border
if(isset ($property->_diagonal))
return $property->_diagonal;
$property->propertyPrepareBind($this, "_diagonal");
* @return PHPExcel_Style_Border
if(isset ($property->_vertical))
return $property->_vertical;
$property->propertyPrepareBind($this, "_vertical");
* @return PHPExcel_Style_Border
if(isset ($property->_horizontal))
return $property->_horizontal;
$property->propertyPrepareBind($this, "_horizontal");
* @return string Hash code
$property->getLeft()->getHashCode()
. $property->getRight()->getHashCode()
. $property->getTop()->getHashCode()
. $property->getBottom()->getHashCode()
. $property->getDiagonal()->getHashCode()
. $property->getVertical()->getHashCode()
. $property->getHorizontal()->getHashCode()
. $property->getDiagonalDirection()
. ($property->getOutline() ? 't' : 'f')
* 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.
* @return string 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.
* @param string $value Hash index
* Implement PHP __clone to create a deep clone, not just a shallow copy.
foreach ($vars as $key => $value) {
$this->$key = clone $value;
|