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

Source for file Function.php

Documentation is available at Function.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_Calculation
  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_Calculation_Function
  31.  *
  32.  * @category   PHPExcel
  33.  * @package    PHPExcel_Calculation
  34.  * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
  35.  */
  36.     /* Function categories */
  37.     const CATEGORY_CUBE                        'Cube';
  38.     const CATEGORY_DATABASE                    'Database';
  39.     const CATEGORY_DATE_AND_TIME            'Date and Time';
  40.     const CATEGORY_ENGINEERING                'Engineering';
  41.     const CATEGORY_FINANCIAL                'Financial';
  42.     const CATEGORY_INFORMATION                'Information';
  43.     const CATEGORY_LOGICAL                    'Logical';
  44.     const CATEGORY_LOOKUP_AND_REFERENCE        'Lookup and Reference';
  45.     const CATEGORY_MATH_AND_TRIG            'Math and Trig';
  46.     const CATEGORY_STATISTICAL                'Statistical';
  47.     const CATEGORY_TEXT_AND_DATA            'Text and Data';
  48.  
  49.     /**
  50.      * Category (represented by CATEGORY_*)
  51.      *
  52.      * @var string 
  53.      */
  54.     private $_category;
  55.  
  56.     /**
  57.      * Excel name
  58.      *
  59.      * @var string 
  60.      */
  61.     private $_excelName;
  62.  
  63.     /**
  64.      * PHPExcel name
  65.      *
  66.      * @var string 
  67.      */
  68.     private $_phpExcelName;
  69.  
  70.     /**
  71.      * Create a new PHPExcel_Calculation_Function
  72.      *
  73.      * @param     string        $pCategory         Category (represented by CATEGORY_*)
  74.      * @param     string        $pExcelName        Excel function name
  75.      * @param     string        $pPHPExcelName    PHPExcel function mapping
  76.      * @throws     Exception
  77.      */
  78.     public function __construct($pCategory null$pExcelName null$pPHPExcelName null)
  79.     {
  80.         if (!is_null($pCategory&& !is_null($pExcelName&& !is_null($pPHPExcelName)) {
  81.             // Initialise values
  82.             $this->_category         $pCategory;
  83.             $this->_excelName         $pExcelName;
  84.             $this->_phpExcelName     $pPHPExcelName;
  85.         else {
  86.             throw new Exception("Invalid parameters passed.");
  87.         }
  88.     }
  89.  
  90.     /**
  91.      * Get Category (represented by CATEGORY_*)
  92.      *
  93.      * @return string 
  94.      */
  95.     public function getCategory({
  96.         return $this->_category;
  97.     }
  98.  
  99.     /**
  100.      * Set Category (represented by CATEGORY_*)
  101.      *
  102.      * @param     string        $value 
  103.      * @throws     Exception
  104.      */
  105.     public function setCategory($value null{
  106.         if (!is_null($value)) {
  107.             $this->_category $value;
  108.         else {
  109.             throw new Exception("Invalid parameter passed.");
  110.         }
  111.     }
  112.  
  113.     /**
  114.      * Get Excel name
  115.      *
  116.      * @return string 
  117.      */
  118.     public function getExcelName({
  119.         return $this->_excelName;
  120.     }
  121.  
  122.     /**
  123.      * Set Excel name
  124.      *
  125.      * @param string    $value 
  126.      */
  127.     public function setExcelName($value{
  128.         $this->_excelName $value;
  129.     }
  130.  
  131.     /**
  132.      * Get PHPExcel name
  133.      *
  134.      * @return string 
  135.      */
  136.     public function getPHPExcelName({
  137.         return $this->_phpExcelName;
  138.     }
  139.  
  140.     /**
  141.      * Set PHPExcel name
  142.      *
  143.      * @param string    $value 
  144.      */
  145.     public function setPHPExcelName($value{
  146.         $this->_phpExcelName $value;
  147.     }
  148. }

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