Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
user.php
1
<?php
2
3
namespace
Bitrix\Sale\Discount\Context
;
4
5
class
User
extends
BaseContext
6
{
12
public
function
__construct
($user)
13
{
14
$this->userId = static::resolveUserId($user);
15
$this->
setUserGroups
(\CUser::getUserGroup($this->userId));
16
}
17
24
private
static
function
resolveUserId($user)
25
{
26
if
($user instanceof \CUser)
27
{
28
return
(
int
)$user->getId();
29
}
30
elseif(is_numeric($user) && (
int
)$user > 0)
31
{
32
return
(
int
)$user;
33
}
34
35
return
static::GUEST_USER_ID;
36
}
37
}
Bitrix\Sale\Discount\Context\BaseContext
Definition
basecontext.php:7
Bitrix\Sale\Discount\Context\BaseContext\setUserGroups
setUserGroups(array $userGroups)
Definition
basecontext.php:38
Bitrix\Sale\Discount\Context\User
Definition
user.php:6
Bitrix\Sale\Discount\Context\User\__construct
__construct($user)
Definition
user.php:12
Bitrix\Sale\Discount\Context
Definition
basecontext.php:2
modules
sale
lib
discount
context
user.php
Создано системой
1.10.0