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-user
Model
Authorization
AdminSessionUserContext.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\User\Model\Authorization
;
8
9
use
Magento\Authorization\Model\UserContextInterface
;
10
use
Magento\Backend\Model\Auth\Session
as AdminSession;
11
15
class
AdminSessionUserContext
implements
UserContextInterface
16
{
20
protected
$_adminSession
;
21
27
public
function
__construct
(AdminSession $adminSession)
28
{
29
$this->_adminSession = $adminSession;
30
}
31
35
public
function
getUserId
()
36
{
37
return
$this->_adminSession->hasUser() ? (int)$this->_adminSession->getUser()->getId() :
null
;
38
}
39
43
public
function
getUserType
()
44
{
45
return
UserContextInterface::USER_TYPE_ADMIN
;
46
}
47
}
Magento\Backend\Model\Auth\Session
Definition:
Session.php:27
Magento\User\Model\Authorization\AdminSessionUserContext\__construct
__construct(AdminSession $adminSession)
Definition:
AdminSessionUserContext.php:27
Magento\User\Model\Authorization
Definition:
AdminSessionUserContext.php:7
Magento\Authorization\Model\UserContextInterface
Definition:
UserContextInterface.php:15
Magento\User\Model\Authorization\AdminSessionUserContext\getUserId
getUserId()
Definition:
AdminSessionUserContext.php:35
Magento\User\Model\Authorization\AdminSessionUserContext
Definition:
AdminSessionUserContext.php:15
Magento\User\Model\Authorization\AdminSessionUserContext\getUserType
getUserType()
Definition:
AdminSessionUserContext.php:43
Magento\Authorization\Model\UserContextInterface\USER_TYPE_ADMIN
const USER_TYPE_ADMIN
Definition:
UserContextInterface.php:21
Magento\User\Model\Authorization\AdminSessionUserContext\$_adminSession
$_adminSession
Definition:
AdminSessionUserContext.php:20