_parent = $parent; } // function __construct() /** * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? * * @param string $pCoord Coordinate address of the cell to check * @return void * @return boolean */ public function isDataSet($pCoord) { if ($pCoord === $this->_currentObjectID) { return true; } // Check if the requested entry exists in the cache return isset($this->_cellCache[$pCoord]); } // function isDataSet() /** * Add or Update a cell in cache * * @param PHPExcel_Cell $cell Cell to update * @return void * @throws Exception */ public function updateCacheData(PHPExcel_Cell $cell) { return $this->addCacheData($cell->getCoordinate(),$cell); } // function updateCacheData() /** * Delete a cell in cache identified by coordinate address * * @param string $pCoord Coordinate address of the cell to delete * @throws Exception */ public function deleteCacheData($pCoord) { if ($pCoord === $this->_currentObjectID) { $this->_currentObject->detach(); $this->_currentObjectID = $this->_currentObject = null; } if (is_object($this->_cellCache[$pCoord])) { $this->_cellCache[$pCoord]->detach(); unset($this->_cellCache[$pCoord]); } $this->_currentCellIsDirty = false; } // function deleteCacheData() /** * Get a list of all cell addresses currently held in cache * * @return array of string */ public function getCellList() { return array_keys($this->_cellCache); } // function getCellList() /** * Sort the list of all cell addresses currently held in cache by row and column * * @return void */ public function getSortedCellList() { $sortKeys = array(); foreach (array_keys($this->_cellCache) as $coord) { list($column,$row) = sscanf($coord,'%[A-Z]%d'); $sortKeys[sprintf('%09d%3s',$row,$column)] = $coord; } ksort($sortKeys); return array_values($sortKeys); } // function sortCellList() protected function _getUniqueID() { if (function_exists('posix_getpid')) { $baseUnique = posix_getpid(); } else { $baseUnique = mt_rand(); } return uniqid($baseUnique,true); } /** * Clone the cell collection * * @return void */ public function copyCellCollection(PHPExcel_Worksheet $parent) { $this->_parent = $parent; if ((!is_null($this->_currentObject)) && (is_object($this->_currentObject))) { $this->_currentObject->attach($parent); } } // function copyCellCollection() }