You are here

public function PHPExcel_CachedObjectStorage_Wincache::getCacheData in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/Wincache.php \PHPExcel_CachedObjectStorage_Wincache::getCacheData()

* Get cell at a specific coordinate * *

Parameters

string $pCoord Coordinate of the cell: * @throws PHPExcel_Exception * @return PHPExcel_Cell Cell that was found, or null if not found

Overrides PHPExcel_CachedObjectStorage_ICache::getCacheData

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/Wincache.php, line 137

Class

PHPExcel_CachedObjectStorage_Wincache
PHPExcel_CachedObjectStorage_Wincache

Code

public function getCacheData($pCoord) {
  if ($pCoord === $this->_currentObjectID) {
    return $this->_currentObject;
  }
  $this
    ->_storeData();

  //	Check if the entry that has been requested actually exists
  $obj = null;
  if (parent::isDataSet($pCoord)) {
    $success = false;
    $obj = wincache_ucache_get($this->_cachePrefix . $pCoord . '.cache', $success);
    if ($success === false) {

      //	Entry no longer exists in WinCache, so clear it from the cache array
      parent::deleteCacheData($pCoord);
      throw new PHPExcel_Exception('Cell entry ' . $pCoord . ' no longer exists in WinCache');
    }
  }
  else {

    //	Return null if requested entry doesn't exist in cache
    return null;
  }

  //	Set current entry to the requested entry
  $this->_currentObjectID = $pCoord;
  $this->_currentObject = unserialize($obj);

  //    Re-attach this as the cell's parent
  $this->_currentObject
    ->attach($this);

  //	Return requested entry
  return $this->_currentObject;
}