Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-authorization
Model
Role.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Authorization\Model
;
7
29
class
Role
extends
\Magento\Framework\Model\AbstractModel
30
{
34
protected
$_eventPrefix
=
'authorization_roles'
;
35
43
public
function
__construct
(
44
\
Magento
\Framework\Model\
Context
$context,
45
\
Magento
\Framework\Registry
$registry
,
46
\
Magento
\Authorization\Model\
ResourceModel
\
Role
$resource
,
47
\
Magento
\Authorization\Model\
ResourceModel
\
Role
\Collection $resourceCollection,
48
array
$data
= []
49
) {
50
parent::__construct($context,
$registry
,
$resource
, $resourceCollection,
$data
);
51
}
52
56
public
function
__sleep
()
57
{
58
$properties
=
parent::__sleep
();
59
return
array_diff(
$properties
, [
'_resource'
,
'_resourceCollection'
]);
60
}
61
65
public
function
__wakeup
()
66
{
67
parent::__wakeup
();
68
$objectManager
=
\Magento\Framework\App\ObjectManager::getInstance
();
69
$this->_resource =
$objectManager
->get(\
Magento
\Authorization\Model\
ResourceModel
\Role::class);
70
$this->_resourceCollection =
$objectManager
->get(
71
\
Magento
\Authorization\Model\
ResourceModel
\
Role
\Collection::class
72
);
73
}
74
80
protected
function
_construct
()
81
{
82
$this->
_init
(\
Magento
\Authorization\Model\
ResourceModel
\Role::class);
83
}
84
90
public
function
update
()
91
{
92
$this->
getResource
()->update($this);
93
return
$this;
94
}
95
101
public
function
getRoleUsers
()
102
{
103
return
$this->
getResource
()->getRoleUsers($this);
104
}
105
}
Magento\Framework\Model\AbstractModel
Definition:
AbstractModel.php:19
Magento\Authorization\Model\Role\__wakeup
__wakeup()
Definition:
Role.php:65
Magento\Framework\App\ObjectManager\getInstance
static getInstance()
Definition:
ObjectManager.php:33
Magento\Framework\Model\AbstractModel\getResource
getResource()
Definition:
AbstractModel.php:891
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
Magento\Authorization\Model\Role\getRoleUsers
getRoleUsers()
Definition:
Role.php:101
$objectManager
$objectManager
Definition:
bootstrap.php:17
Magento\Framework\Interception\__sleep
__sleep()
Definition:
Interceptor.php:66
$resource
$resource
Definition:
bulk.php:12
Magento\Authorization\Model\Role\_construct
_construct()
Definition:
Role.php:80
$registry
$registry
Definition:
bundle_product_with_not_visible_children_rollback.php:16
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Authorization\Model\Role\update
update()
Definition:
Role.php:90
Magento\Authorization\Model\Role\__sleep
__sleep()
Definition:
Role.php:56
Magento
Magento\Authorization\Model\Role\__construct
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Authorization\Model\ResourceModel\Role $resource, \Magento\Authorization\Model\ResourceModel\Role\Collection $resourceCollection, array $data=[])
Definition:
Role.php:43
Magento\Authorization\Model
Context
Definition:
ClassesForConstructorIntegrity.php:33
Magento\Authorization\Model\Role\$_eventPrefix
$_eventPrefix
Definition:
Role.php:34
$properties
$properties
Definition:
categories.php:26
Magento\Authorization\Model\Role
Definition:
Role.php:29
Magento\Framework\Interception\__wakeup
__wakeup()
Definition:
Interceptor.php:82
Magento\Framework\Model\AbstractModel\_init
_init($resourceModel)
Definition:
AbstractModel.php:213