Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Totals.php
Go to the documentation of this file.
1 <?php
7 
9 
15 {
21  public function __construct(
22  \Magento\Framework\View\Element\Template\Context $context,
23  \Magento\Framework\Registry $registry,
24  array $data = []
25  ) {
26  parent::__construct($context, $registry, $data);
27  $this->_isScopePrivate = true;
28  }
29 
33  protected $_invoice = null;
34 
38  public function getInvoice()
39  {
40  if ($this->_invoice === null) {
41  if ($this->hasData('invoice')) {
42  $this->_invoice = $this->_getData('invoice');
43  } elseif ($this->_coreRegistry->registry('current_invoice')) {
44  $this->_invoice = $this->_coreRegistry->registry('current_invoice');
45  } elseif ($this->getParentBlock()->getInvoice()) {
46  $this->_invoice = $this->getParentBlock()->getInvoice();
47  }
48  }
49  return $this->_invoice;
50  }
51 
56  public function setInvoice($invoice)
57  {
58  $this->_invoice = $invoice;
59  return $this;
60  }
61 
67  public function getSource()
68  {
69  return $this->getInvoice();
70  }
71 
77  protected function _initTotals()
78  {
79  parent::_initTotals();
80  $this->removeTotal('base_grandtotal');
81  return $this;
82  }
83 }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Registry $registry, array $data=[])
Definition: Totals.php:21
$invoice