_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) { $pCoord = $cell->getCoordinate(); return $this->addCacheData($pCoord,$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 (isset($this->_cellCache[$pCoord])) { $this->_cellCache[$pCoord]->detach(); unset($this->_cellCache[$pCoord]); } } // 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 ($this->_cellCache as $coord => $value) { preg_match('/^(\w+)(\d+)$/U',$coord,$matches); list(,$colNum,$rowNum) = $matches; $sortKeys[$coord] = str_pad($rowNum . str_pad($colNum,3,'@',STR_PAD_LEFT),12,'0',STR_PAD_LEFT); } asort($sortKeys); return array_keys($sortKeys); } // function sortCellList() }