Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AdminSessionUserContext.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Backend\Model\Auth\Session as AdminSession;
11 
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  {
46  }
47 }