Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ParamOverriderCustomerId.php
Go to the documentation of this file.
1 <?php
8 
11 
16 {
20  private $userContext;
21 
27  public function __construct(UserContextInterface $userContext)
28  {
29  $this->userContext = $userContext;
30  }
31 
35  public function getOverriddenValue()
36  {
37  if ($this->userContext->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER) {
38  return $this->userContext->getUserId();
39  }
40  return null;
41  }
42 }