CustomerGrid.php 937 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Paypal\Controller\Adminhtml\Billing\Agreement;
  8. use Magento\Customer\Controller\RegistryConstants;
  9. class CustomerGrid extends \Magento\Paypal\Controller\Adminhtml\Billing\Agreement
  10. {
  11. /**
  12. * Initialize customer by ID specified in request
  13. *
  14. * @return $this
  15. */
  16. protected function initCurrentCustomer()
  17. {
  18. $customerId = (int)$this->getRequest()->getParam('id');
  19. if ($customerId) {
  20. $this->_coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER_ID, $customerId);
  21. }
  22. return $this;
  23. }
  24. /**
  25. * Customer billing agreements ajax action
  26. *
  27. * @return void
  28. */
  29. public function execute()
  30. {
  31. $this->initCurrentCustomer();
  32. $this->_view->loadLayout(false);
  33. $this->_view->renderLayout();
  34. }
  35. }