Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Customer.php
Go to the documentation of this file.
1 <?php
14 
19 abstract class Customer extends \Magento\Backend\App\Action
20 {
24  protected $_fileFactory;
25 
30  public function __construct(
31  \Magento\Backend\App\Action\Context $context,
32  \Magento\Framework\App\Response\Http\FileFactory $fileFactory
33  ) {
34  $this->_fileFactory = $fileFactory;
35  parent::__construct($context);
36  }
37 
43  public function _initAction()
44  {
45  $act = $this->getRequest()->getActionName();
46  if (!$act) {
47  $act = 'default';
48  }
49 
50  $this->_view->loadLayout();
51  $this->_addBreadcrumb(__('Reports'), __('Reports'));
52  $this->_addBreadcrumb(__('Customers'), __('Customers'));
53  return $this;
54  }
55 
61  protected function _isAllowed()
62  {
63  switch ($this->getRequest()->getActionName()) {
64  case 'accounts':
65  return $this->_authorization->isAllowed('Magento_Reports::accounts');
66  break;
67  case 'orders':
68  return $this->_authorization->isAllowed('Magento_Reports::customers_orders');
69  break;
70  case 'totals':
71  return $this->_authorization->isAllowed('Magento_Reports::totals');
72  break;
73  default:
74  return $this->_authorization->isAllowed('Magento_Reports::customers');
75  break;
76  }
77  }
78 }
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\App\Response\Http\FileFactory $fileFactory)
Definition: Customer.php:30
__()
Definition: __.php:13
_addBreadcrumb($label, $title, $link=null)