PHPExcel_RichText
[ class tree: PHPExcel_RichText ] [ index: PHPExcel_RichText ] [ all elements ]

Source for file Run.php

Documentation is available at Run.php

  1. <?php
  2. /**
  3.  * PHPExcel
  4.  *
  5.  * This library is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU Lesser General Public
  7.  * License as published by the Free Software Foundation; either
  8.  * version 2.1 of the License, or (at your option) any later version.
  9.  * 
  10.  * This library is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * Lesser General Public License for more details.
  14.  * 
  15.  * You should have received a copy of the GNU Lesser General Public
  16.  * License along with this library; if not, write to the Free Software
  17.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  18.  *
  19.  * @category   PHPExcel
  20.  * @package    PHPExcel_RichText
  21.  * @copyright  Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
  22.  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
  23.  * @version    1.6.5, 2009-01-05
  24.  */
  25.  
  26.  
  27. /** PHPExcel_RichText_ITextElement */
  28. require_once 'PHPExcel/RichText/ITextElement.php';
  29.  
  30. /** PHPExcel_RichText_TextElement */
  31. require_once 'PHPExcel/RichText/TextElement.php';
  32.  
  33. /** PHPExcel_Style_Font */
  34. require_once 'PHPExcel/Style/Font.php';
  35.  
  36.  
  37. /**
  38.  * PHPExcel_RichText_Run
  39.  *
  40.  * @category   PHPExcel
  41.  * @package    PHPExcel_RichText
  42.  * @copyright  Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
  43.  */
  44. {    
  45.     /**
  46.      * Font
  47.      *
  48.      * @var PHPExcel_Style_Font 
  49.      */
  50.     private $_font;
  51.     
  52.     /**
  53.      * Create a new PHPExcel_RichText_Run instance
  54.      *
  55.      * @param     string        $pText        Text
  56.      */
  57.     public function __construct($pText '')
  58.     {
  59.         // Initialise variables
  60.         $this->setText($pText);
  61.         $this->_font = new PHPExcel_Style_Font();
  62.     }
  63.     
  64.     /**
  65.      * Get font
  66.      *
  67.      * @return PHPExcel_Style_Font 
  68.      */    
  69.     public function getFont({
  70.         return $this->_font;
  71.     }
  72.     
  73.     /**
  74.      * Set font
  75.      *
  76.      * @param    PHPExcel_Style_Font        $pFont        Font
  77.      * @throws     Exception
  78.      */    
  79.     public function setFont(PHPExcel_Style_Font $pFont null{
  80.         $this->_font = $pFont;
  81.     }
  82.     
  83.     /**
  84.      * Get hash code
  85.      *
  86.      * @return string    Hash code
  87.      */    
  88.     public function getHashCode({
  89.         return md5(
  90.               $this->getText()
  91.             . $this->_font->getHashCode()
  92.             . __CLASS__
  93.         );
  94.     }
  95.         
  96.     /**
  97.      * Implement PHP __clone to create a deep clone, not just a shallow copy.
  98.      */
  99.     public function __clone({
  100.         $vars get_object_vars($this);
  101.         foreach ($vars as $key => $value{
  102.             if (is_object($value)) {
  103.                 $this->$key clone $value;
  104.             else {
  105.                 $this->$key $value;
  106.             }
  107.         }
  108.     }
  109. }

Documentation generated on Mon, 05 Jan 2009 20:38:27 +0100 by phpDocumentor 1.4.1