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

Source for file Hyperlink.php

Documentation is available at Hyperlink.php

  1. <?php
  2. /**
  3.  * PHPExcel
  4.  *
  5.  * Copyright (c) 2006 - 2011 PHPExcel
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2.1 of the License, or (at your option) any later version.
  11.  * 
  12.  * This library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Lesser General Public License for more details.
  16.  * 
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the Free Software
  19.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  20.  *
  21.  * @category   PHPExcel
  22.  * @package    PHPExcel_Cell
  23.  * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
  24.  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
  25.  * @version    1.7.6, 2011-02-27
  26.  */
  27.  
  28.  
  29. /**
  30.  * PHPExcel_Cell_Hyperlink
  31.  *
  32.  * @category   PHPExcel
  33.  * @package    PHPExcel_Cell
  34.  * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
  35.  */
  36. {
  37.     /**
  38.      * URL to link the cell to
  39.      *
  40.      * @var string 
  41.      */
  42.     private $_url;
  43.     
  44.     /**
  45.      * Tooltip to display on the hyperlink
  46.      *
  47.      * @var string 
  48.      */
  49.     private $_tooltip;    
  50.     
  51.     /**
  52.      * Create a new PHPExcel_Cell_Hyperlink
  53.      *
  54.      * @param     string                $pUrl        Url to link the cell to
  55.      * @param    string                $pTooltip    Tooltip to display on the hyperlink
  56.      * @throws    Exception
  57.      */
  58.     public function __construct($pUrl ''$pTooltip '')
  59.     {
  60.         // Initialise member variables
  61.         $this->_url         $pUrl;
  62.         $this->_tooltip     $pTooltip;
  63.     }
  64.     
  65.     /**
  66.      * Get URL
  67.      *
  68.      * @return string 
  69.      */
  70.     public function getUrl({
  71.         return $this->_url;
  72.     }
  73.  
  74.     /**
  75.      * Set URL
  76.      *
  77.      * @param    string    $value 
  78.      * @return PHPExcel_Cell_Hyperlink 
  79.      */
  80.     public function setUrl($value ''{
  81.         $this->_url $value;
  82.         return $this;
  83.     }
  84.     
  85.     /**
  86.      * Get tooltip
  87.      *
  88.      * @return string 
  89.      */
  90.     public function getTooltip({
  91.         return $this->_tooltip;
  92.     }
  93.  
  94.     /**
  95.      * Set tooltip
  96.      *
  97.      * @param    string    $value 
  98.      * @return PHPExcel_Cell_Hyperlink 
  99.      */
  100.     public function setTooltip($value ''{
  101.         $this->_tooltip $value;
  102.         return $this;
  103.     }
  104.     
  105.     /**
  106.      * Is this hyperlink internal? (to another sheet)
  107.      *
  108.      * @return boolean 
  109.      */
  110.     public function isInternal({
  111.         return strpos($this->_url'sheet://'!== false;
  112.     }
  113.     
  114.     /**
  115.      * Get hash code
  116.      *
  117.      * @return string    Hash code
  118.      */    
  119.     public function getHashCode({
  120.         return md5(
  121.               $this->_url
  122.             . $this->_tooltip
  123.             . __CLASS__
  124.         );
  125.     }
  126. }

Documentation generated on Sun, 27 Feb 2011 16:32:23 -0800 by phpDocumentor 1.4.3