HashMapInterface.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\CatalogUrlRewrite\Model\Map;
  7. use Magento\Framework\DB\Select;
  8. /**
  9. * Interface for a hash data map
  10. *
  11. * It is used for classes that will build hash maps and store them into memory
  12. * The initialization is done transparently whenever getAllData or getData is called
  13. * The map, upon initialization, might have a dependency on some other DataMapInterfaces
  14. * The map has to free memory after we're done using it
  15. * We need to destroy those maps too when calling resetData
  16. */
  17. interface HashMapInterface
  18. {
  19. /**
  20. * Gets all data from a map identified by a category Id
  21. *
  22. * @param int $categoryId
  23. * @return array
  24. */
  25. public function getAllData($categoryId);
  26. /**
  27. * Gets data by criteria from a map identified by a category Id
  28. *
  29. * @param int $categoryId
  30. * @param string $key
  31. * @return array
  32. */
  33. public function getData($categoryId, $key);
  34. /**
  35. * Resets current map by freeing memory and also to its dependencies
  36. *
  37. * @param int $categoryId
  38. * @return void
  39. */
  40. public function resetData($categoryId);
  41. }