/** * Get an instance of this class * * @access public * @param PHPExcel $workbook Injected workbook for working with a PHPExcel object, * or NULL to create a standalone claculation engine * @return PHPExcel_Calculation */ public static function getInstance(PHPExcel $workbook = null) { if ($workbook !== null) { $instance = $workbook->getCalculationEngine(); if (isset($instance)) { return $instance; } } if (!isset(self::$instance) || self::$instance === null) { self::$instance = new PHPExcel_Calculation(); } return self::$instance; }
/** * Get an instance of this class * * @access public * @param PHPExcel $workbook Injected workbook for working with a PHPExcel object, * or NULL to create a standalone claculation engine * @return PHPExcel_Calculation */ public static function getInstance(PHPExcel $workbook = null) { if ($workbook !== null) { if (isset(self::$workbookSets[$workbook->getID()])) { return self::$workbookSets[$workbook->getID()]; } return new PHPExcel_Calculation($workbook); } if (!isset(self::$instance) || self::$instance === null) { self::$instance = new PHPExcel_Calculation(); } return self::$instance; }