5 * Copyright (c) 2006 - 2014 PHPExcel
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.
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.
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
22 * @package PHPExcel_Calculation
23 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
24 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25 * @version ##VERSION##, ##DATE##
30 * PHPExcel_Calculation_Function
33 * @package PHPExcel_Calculation
34 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
36 class PHPExcel_Calculation_Function
{
37 /* Function categories */
38 const CATEGORY_CUBE
= 'Cube';
39 const CATEGORY_DATABASE
= 'Database';
40 const CATEGORY_DATE_AND_TIME
= 'Date and Time';
41 const CATEGORY_ENGINEERING
= 'Engineering';
42 const CATEGORY_FINANCIAL
= 'Financial';
43 const CATEGORY_INFORMATION
= 'Information';
44 const CATEGORY_LOGICAL
= 'Logical';
45 const CATEGORY_LOOKUP_AND_REFERENCE
= 'Lookup and Reference';
46 const CATEGORY_MATH_AND_TRIG
= 'Math and Trig';
47 const CATEGORY_STATISTICAL
= 'Statistical';
48 const CATEGORY_TEXT_AND_DATA
= 'Text and Data';
51 * Category (represented by CATEGORY_*)
69 private $_phpExcelName;
72 * Create a new PHPExcel_Calculation_Function
74 * @param string $pCategory Category (represented by CATEGORY_*)
75 * @param string $pExcelName Excel function name
76 * @param string $pPHPExcelName PHPExcel function mapping
77 * @throws PHPExcel_Calculation_Exception
79 public function __construct($pCategory = NULL, $pExcelName = NULL, $pPHPExcelName = NULL)
81 if (($pCategory !== NULL) && ($pExcelName !== NULL) && ($pPHPExcelName !== NULL)) {
83 $this->_category
= $pCategory;
84 $this->_excelName
= $pExcelName;
85 $this->_phpExcelName
= $pPHPExcelName;
87 throw new PHPExcel_Calculation_Exception("Invalid parameters passed.");
92 * Get Category (represented by CATEGORY_*)
96 public function getCategory() {
97 return $this->_category
;
101 * Set Category (represented by CATEGORY_*)
103 * @param string $value
104 * @throws PHPExcel_Calculation_Exception
106 public function setCategory($value = null) {
107 if (!is_null($value)) {
108 $this->_category
= $value;
110 throw new PHPExcel_Calculation_Exception("Invalid parameter passed.");
119 public function getExcelName() {
120 return $this->_excelName
;
126 * @param string $value
128 public function setExcelName($value) {
129 $this->_excelName
= $value;
137 public function getPHPExcelName() {
138 return $this->_phpExcelName
;
144 * @param string $value
146 public function setPHPExcelName($value) {
147 $this->_phpExcelName
= $value;