BlockInterface.php 910 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Widget Block Interface
  8. *
  9. * @author Magento Core Team <core@magentocommerce.com>
  10. */
  11. namespace Magento\Widget\Block;
  12. /**
  13. * Interface \Magento\Widget\Block\BlockInterface
  14. *
  15. */
  16. interface BlockInterface
  17. {
  18. /**
  19. * Add data to the widget.
  20. *
  21. * Retains previous data in the widget.
  22. *
  23. * @param array $arr
  24. * @return $this
  25. */
  26. public function addData(array $arr);
  27. /**
  28. * Overwrite data in the widget.
  29. *
  30. * Param $key can be string or array.
  31. * If $key is string, the attribute value will be overwritten by $value.
  32. * If $key is an array, it will overwrite all the data in the widget.
  33. *
  34. * @param string|array $key
  35. * @param mixed $value
  36. * @return $this
  37. */
  38. public function setData($key, $value = null);
  39. }