public function PHPExcel_CachedObjectStorage_PHPTemp::getCacheData in Loft Data Grids 6.2
Same name and namespace in other branches
- 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/PHPTemp.php \PHPExcel_CachedObjectStorage_PHPTemp::getCacheData()
Get cell at a specific coordinate
Parameters
string $pCoord Coordinate of the cell:
Return value
PHPExcel_Cell Cell that was found, or null if not found
Throws
Overrides PHPExcel_CachedObjectStorage_ICache::getCacheData
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ CachedObjectStorage/ PHPTemp.php, line 103
Class
- PHPExcel_CachedObjectStorage_PHPTemp
- PHPExcel_CachedObjectStorage_PHPTemp
Code
public function getCacheData($pCoord) {
if ($pCoord === $this->_currentObjectID) {
return $this->_currentObject;
}
$this
->_storeData();
// Check if the entry that has been requested actually exists
if (!isset($this->_cellCache[$pCoord])) {
// Return null if requested entry doesn't exist in cache
return null;
}
// Set current entry to the requested entry
$this->_currentObjectID = $pCoord;
fseek($this->_fileHandle, $this->_cellCache[$pCoord]['ptr']);
$this->_currentObject = unserialize(fread($this->_fileHandle, $this->_cellCache[$pCoord]['sz']));
// Re-attach this as the cell's parent
$this->_currentObject
->attach($this);
// Return requested entry
return $this->_currentObject;
}