![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-paypal/Model/Billing/Agreement/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Paypal\Model\Billing\Agreement; /** * Orders grid massaction items updater */ class OrdersUpdater implements \Magento\Framework\View\Layout\Argument\UpdaterInterface { /** * @var \Magento\Framework\Registry */ protected $_registryManager; /** * @var \Magento\Paypal\Model\ResourceModel\Billing\Agreement */ protected $_agreementResource; /** * @param \Magento\Framework\Registry $coreRegistry * @param \Magento\Paypal\Model\ResourceModel\Billing\Agreement $agreementResource * @param array $data * @throws \InvalidArgumentException */ public function __construct( \Magento\Framework\Registry $coreRegistry, \Magento\Paypal\Model\ResourceModel\Billing\Agreement $agreementResource, array $data = [] ) { $this->_registryManager = isset($data['registry']) ? $data['registry'] : $coreRegistry; $this->_agreementResource = $agreementResource; if (false === $this->_registryManager instanceof \Magento\Framework\Registry) { throw new \InvalidArgumentException('registry object has to be an instance of \Magento\Framework\Registry'); } } /** * Add billing agreement filter * * @param mixed $argument * @return mixed * @throws \DomainException */ public function update($argument) { $billingAgreement = $this->_registryManager->registry('current_billing_agreement'); if (!$billingAgreement) { throw new \DomainException('Undefined billing agreement object'); } $this->_agreementResource->addOrdersFilter($argument, $billingAgreement->getId()); return $argument; } }