Plugin.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Widget\Model\ResourceModel\Layout;
  7. /**
  8. * Class Plugin
  9. */
  10. class Plugin
  11. {
  12. /**
  13. * @var \Magento\Widget\Model\ResourceModel\Layout\Update
  14. */
  15. private $update;
  16. /**
  17. * @param \Magento\Widget\Model\ResourceModel\Layout\Update $update
  18. */
  19. public function __construct(
  20. \Magento\Widget\Model\ResourceModel\Layout\Update $update
  21. ) {
  22. $this->update = $update;
  23. }
  24. /**
  25. * Around getDbUpdateString
  26. *
  27. * @param \Magento\Framework\View\Model\Layout\Merge $subject
  28. * @param callable $proceed
  29. * @param string $handle
  30. * @return string
  31. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  32. */
  33. public function aroundGetDbUpdateString(
  34. \Magento\Framework\View\Model\Layout\Merge $subject,
  35. \Closure $proceed,
  36. $handle
  37. ) {
  38. return $this->update->fetchUpdatesByHandle($handle, $subject->getTheme(), $subject->getScope());
  39. }
  40. }