Checkmo.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\OfflinePayments\Block\Info;
  7. class Checkmo extends \Magento\Payment\Block\Info
  8. {
  9. /**
  10. * @var string
  11. */
  12. protected $_payableTo;
  13. /**
  14. * @var string
  15. */
  16. protected $_mailingAddress;
  17. /**
  18. * @var string
  19. */
  20. protected $_template = 'Magento_OfflinePayments::info/checkmo.phtml';
  21. /**
  22. * Enter description here...
  23. *
  24. * @return string
  25. */
  26. public function getPayableTo()
  27. {
  28. if ($this->_payableTo === null) {
  29. $this->_convertAdditionalData();
  30. }
  31. return $this->_payableTo;
  32. }
  33. /**
  34. * Enter description here...
  35. *
  36. * @return string
  37. */
  38. public function getMailingAddress()
  39. {
  40. if ($this->_mailingAddress === null) {
  41. $this->_convertAdditionalData();
  42. }
  43. return $this->_mailingAddress;
  44. }
  45. /**
  46. * @deprecated 100.1.1
  47. * @return $this
  48. */
  49. protected function _convertAdditionalData()
  50. {
  51. $this->_payableTo = $this->getInfo()->getAdditionalInformation('payable_to');
  52. $this->_mailingAddress = $this->getInfo()->getAdditionalInformation('mailing_address');
  53. return $this;
  54. }
  55. /**
  56. * @return string
  57. */
  58. public function toPdf()
  59. {
  60. $this->setTemplate('Magento_OfflinePayments::info/pdf/checkmo.phtml');
  61. return $this->toHtml();
  62. }
  63. }