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