ProcessorInterface.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\View\Layout;
  7. /**
  8. * Interface ProcessorInterface
  9. */
  10. interface ProcessorInterface
  11. {
  12. /**
  13. * Add XML update instruction
  14. *
  15. * @param string $update
  16. * @return ProcessorInterface
  17. */
  18. public function addUpdate($update);
  19. /**
  20. * Get all registered updates as array
  21. *
  22. * @return array
  23. */
  24. public function asArray();
  25. /**
  26. * Get all registered updates as string
  27. *
  28. * @return string
  29. */
  30. public function asString();
  31. /**
  32. * Add handle(s) to update
  33. *
  34. * @param string|string[] $handleName
  35. * @return ProcessorInterface
  36. */
  37. public function addHandle($handleName);
  38. /**
  39. * Remove handle from update
  40. *
  41. * @param string $handleName
  42. * @return ProcessorInterface
  43. */
  44. public function removeHandle($handleName);
  45. /**
  46. * Get handle names array
  47. *
  48. * @return array
  49. */
  50. public function getHandles();
  51. /**
  52. * Add page handles
  53. *
  54. * Add the first existing (declared in layout updates) page handle along with all parents to the update.
  55. * Return whether any page handles have been added or not.
  56. *
  57. * @param array $handlesToTry
  58. * @return bool
  59. */
  60. public function addPageHandles(array $handlesToTry);
  61. /**
  62. * Retrieve all design abstractions that exist in the system.
  63. *
  64. * @return array
  65. */
  66. public function getAllDesignAbstractions();
  67. /**
  68. * Check page_layout design abstractions that exist in the system
  69. *
  70. * @param array $abstraction
  71. * @return bool
  72. */
  73. public function isPageLayoutDesignAbstraction(array $abstraction);
  74. /**
  75. * Check custom design abstractions that exist in the system
  76. *
  77. * @param array $abstraction
  78. * @return bool
  79. */
  80. public function isCustomerDesignAbstraction(array $abstraction);
  81. /**
  82. * Load layout updates by handles
  83. *
  84. * @param array|string $handles
  85. * @throws \Magento\Framework\Exception\LocalizedException
  86. * @return ProcessorInterface
  87. */
  88. public function load($handles = []);
  89. /**
  90. * Get layout updates as \Magento\Framework\View\Layout\Element object
  91. *
  92. * @return \SimpleXMLElement
  93. */
  94. public function asSimplexml();
  95. /**
  96. * Retrieve already merged layout updates from files for specified area/theme/package/store
  97. *
  98. * @return \Magento\Framework\View\Layout\Element
  99. */
  100. public function getFileLayoutUpdatesXml();
  101. /**
  102. * Retrieve containers from the update handles that have been already loaded
  103. *
  104. * Result format:
  105. * array(
  106. * 'container_name' => 'Container Label',
  107. * // ...
  108. * )
  109. *
  110. * @return array
  111. */
  112. public function getContainers();
  113. /**
  114. * Return cache ID based current area/package/theme/store, handles and cache key(s)
  115. *
  116. * @return string
  117. */
  118. public function getCacheId();
  119. }