DatabaseMapInterface.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. /**
  8. * Interface for a mysql data type of a map
  9. *
  10. * Is used to get data by a unique key from a temporary table in mysql to prevent memory usage
  11. * It internally holds the knowledge the creation of the actual data and it initializes itself when we call getData
  12. * We should always call destroyTableAdapter when we don't need anymore the temporary tables
  13. */
  14. interface DatabaseMapInterface
  15. {
  16. /**
  17. * Gets data by key from a map identified by a category Id
  18. *
  19. * The key is a unique identifier that matches the values of the index used to build the temporary table
  20. *
  21. * Example "1_2" where ids would correspond to store_id entity_id
  22. *
  23. * @param int $categoryId
  24. * @param string $key
  25. * @return array
  26. */
  27. public function getData($categoryId, $key);
  28. /**
  29. * Destroys data in the temporary table by categoryId
  30. * It also destroys the data in other maps that are dependencies used to construct the data
  31. *
  32. * @param int $categoryId
  33. * @return void
  34. */
  35. public function destroyTableAdapter($categoryId);
  36. }