Button.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Wishlist block customer item cart column
  8. *
  9. * @author Magento Core Team <core@magentocommerce.com>
  10. */
  11. namespace Magento\Wishlist\Block\Customer\Wishlist;
  12. /**
  13. * @api
  14. * @since 100.0.2
  15. */
  16. class Button extends \Magento\Framework\View\Element\Template
  17. {
  18. /**
  19. * Wishlist config
  20. *
  21. * @var \Magento\Wishlist\Model\Config
  22. */
  23. protected $_wishlistConfig;
  24. /**
  25. * Wishlist data
  26. *
  27. * @var \Magento\Wishlist\Helper\Data
  28. */
  29. protected $_wishlistData = null;
  30. /**
  31. * @param \Magento\Framework\View\Element\Template\Context $context
  32. * @param \Magento\Wishlist\Helper\Data $wishlistData
  33. * @param \Magento\Wishlist\Model\Config $wishlistConfig
  34. * @param array $data
  35. */
  36. public function __construct(
  37. \Magento\Framework\View\Element\Template\Context $context,
  38. \Magento\Wishlist\Helper\Data $wishlistData,
  39. \Magento\Wishlist\Model\Config $wishlistConfig,
  40. array $data = []
  41. ) {
  42. $this->_wishlistData = $wishlistData;
  43. $this->_wishlistConfig = $wishlistConfig;
  44. parent::__construct($context, $data);
  45. }
  46. /**
  47. * Retrieve current wishlist
  48. *
  49. * @return \Magento\Wishlist\Model\Wishlist
  50. */
  51. public function getWishlist()
  52. {
  53. return $this->_wishlistData->getWishlist();
  54. }
  55. /**
  56. * Retrieve wishlist config
  57. *
  58. * @return \Magento\Wishlist\Model\Config
  59. */
  60. public function getConfig()
  61. {
  62. return $this->_wishlistConfig;
  63. }
  64. }