Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AuthorizationFactory.php
Go to the documentation of this file.
1 <?php
7 
14 {
21 
28 
34  protected $_roleFactory;
35 
41  protected $_rulesFactory;
42 
51  public function __construct(
52  \Magento\Authorization\Model\ResourceModel\Role\CollectionFactory $roleCollectionFactory,
53  \Magento\Authorization\Model\ResourceModel\Rules\CollectionFactory $rulesCollectionFactory,
54  \Magento\Authorization\Model\RoleFactory $roleFactory,
55  \Magento\Authorization\Model\RulesFactory $rulesFactory
56  ) {
57  $this->_roleCollectionFactory = $roleCollectionFactory;
58  $this->_rulesCollectionFactory = $rulesCollectionFactory;
59  $this->_roleFactory = $roleFactory;
60  $this->_rulesFactory = $rulesFactory;
61  }
62 
68  public function createRoleCollection()
69  {
70  return $this->_roleCollectionFactory->create();
71  }
72 
78  public function createRulesCollection()
79  {
80  return $this->_rulesCollectionFactory->create();
81  }
82 
88  public function createRole()
89  {
90  return $this->_roleFactory->create();
91  }
92 
98  public function createRules()
99  {
100  return $this->_rulesFactory->create();
101  }
102 }
__construct(\Magento\Authorization\Model\ResourceModel\Role\CollectionFactory $roleCollectionFactory, \Magento\Authorization\Model\ResourceModel\Rules\CollectionFactory $rulesCollectionFactory, \Magento\Authorization\Model\RoleFactory $roleFactory, \Magento\Authorization\Model\RulesFactory $rulesFactory)