123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Authorization\Setup;
- /**
- * Resource Setup Model
- *
- * @codeCoverageIgnore
- */
- class AuthorizationFactory
- {
- /**
- * Role model factory
- *
- * @var \Magento\Authorization\Model\RoleFactory
- */
- protected $_roleCollectionFactory;
- /**
- * Factory for rules model
- *
- * @var \Magento\Authorization\Model\RulesFactory
- */
- protected $_rulesCollectionFactory;
- /**
- * Role model factory
- *
- * @var \Magento\Authorization\Model\RoleFactory
- */
- protected $_roleFactory;
- /**
- * Rules model factory
- *
- * @var \Magento\Authorization\Model\RulesFactory
- */
- protected $_rulesFactory;
- /**
- * Init
- *
- * @param \Magento\Authorization\Model\ResourceModel\Role\CollectionFactory $roleCollectionFactory
- * @param \Magento\Authorization\Model\ResourceModel\Rules\CollectionFactory $rulesCollectionFactory
- * @param \Magento\Authorization\Model\RoleFactory $roleFactory
- * @param \Magento\Authorization\Model\RulesFactory $rulesFactory
- */
- public function __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
- ) {
- $this->_roleCollectionFactory = $roleCollectionFactory;
- $this->_rulesCollectionFactory = $rulesCollectionFactory;
- $this->_roleFactory = $roleFactory;
- $this->_rulesFactory = $rulesFactory;
- }
- /**
- * Creates role collection
- *
- * @return \Magento\Authorization\Model\ResourceModel\Role\Collection
- */
- public function createRoleCollection()
- {
- return $this->_roleCollectionFactory->create();
- }
- /**
- * Creates rules collection
- *
- * @return \Magento\Authorization\Model\ResourceModel\Rules\Collection
- */
- public function createRulesCollection()
- {
- return $this->_rulesCollectionFactory->create();
- }
- /**
- * Creates role model
- *
- * @return \Magento\Authorization\Model\Role
- */
- public function createRole()
- {
- return $this->_roleFactory->create();
- }
- /**
- * Creates rules model
- *
- * @return \Magento\Authorization\Model\Rules
- */
- public function createRules()
- {
- return $this->_rulesFactory->create();
- }
- }
|