ICache.Class.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: phperstar
  5. * Date: 2020/8/10
  6. * Time: 6:36 PM
  7. */
  8. namespace Util\PHPExcel\CachedObjectStorage;
  9. use Util\PHPExcel\Worksheet;
  10. use Util\PHPExcel\Cell;
  11. interface ICache
  12. {
  13. /**
  14. * Add or Update a cell in cache identified by coordinate address
  15. *
  16. * @param string $pCoord Coordinate address of the cell to update
  17. * @param PHPExcel_Cell $cell Cell to update
  18. * @return PHPExcel_Cell
  19. * @throws PHPExcel_Exception
  20. */
  21. public function addCacheData($pCoord, Cell $cell);
  22. /**
  23. * Add or Update a cell in cache
  24. *
  25. * @param PHPExcel_Cell $cell Cell to update
  26. * @return PHPExcel_Cell
  27. * @throws PHPExcel_Exception
  28. */
  29. public function updateCacheData(Cell $cell);
  30. /**
  31. * Fetch a cell from cache identified by coordinate address
  32. *
  33. * @param string $pCoord Coordinate address of the cell to retrieve
  34. * @return PHPExcel_Cell Cell that was found, or null if not found
  35. * @throws PHPExcel_Exception
  36. */
  37. public function getCacheData($pCoord);
  38. /**
  39. * Delete a cell in cache identified by coordinate address
  40. *
  41. * @param string $pCoord Coordinate address of the cell to delete
  42. * @throws PHPExcel_Exception
  43. */
  44. public function deleteCacheData($pCoord);
  45. /**
  46. * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
  47. *
  48. * @param string $pCoord Coordinate address of the cell to check
  49. * @return boolean
  50. */
  51. public function isDataSet($pCoord);
  52. /**
  53. * Get a list of all cell addresses currently held in cache
  54. *
  55. * @return string[]
  56. */
  57. public function getCellList();
  58. /**
  59. * Get the list of all cell addresses currently held in cache sorted by column and row
  60. *
  61. * @return string[]
  62. */
  63. public function getSortedCellList();
  64. /**
  65. * Clone the cell collection
  66. *
  67. * @param PHPExcel_Worksheet $parent The new worksheet
  68. * @return void
  69. */
  70. public function copyCellCollection(Worksheet $parent);
  71. /**
  72. * Identify whether the caching method is currently available
  73. * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
  74. *
  75. * @return boolean
  76. */
  77. public static function cacheMethodIsAvailable();
  78. }