Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
StoreViewRule.php
1
<?php
2
3
namespace
Bitrix\Catalog\Access\Rule
;
4
5
use
Bitrix\Catalog\Access\Model\StoreDocumentElement
;
6
use \Bitrix\Catalog\Access\Permission\PermissionDictionary;
7
8
class
StoreViewRule
extends
VariableRule
9
{
10
protected
function
loadAvailableValues
(): array
11
{
12
return
array_column(PermissionDictionary::getStoreVariables(),
'id'
);
13
}
14
15
protected
function
check
($params): bool
16
{
17
$item = $params[
'item'
] ??
null
;
18
if
($item instanceof
StoreDocumentElement
)
19
{
20
$params[
'value'
] = $item->getStoreIds();
21
}
22
23
return
parent::check($params);
24
}
25
}
Bitrix\Catalog\Access\Model\StoreDocumentElement
Definition
StoreDocumentElement.php:9
Bitrix\Catalog\Access\Rule\StoreViewRule
Definition
StoreViewRule.php:9
Bitrix\Catalog\Access\Rule\StoreViewRule\check
check($params)
Definition
StoreViewRule.php:15
Bitrix\Catalog\Access\Rule\StoreViewRule\loadAvailableValues
loadAvailableValues()
Definition
StoreViewRule.php:10
Bitrix\Catalog\Access\Rule\VariableRule
Definition
VariableRule.php:23
Bitrix\Catalog\Access\Rule
Definition
BaseRule.php:3
modules
catalog
lib
Access
Rule
StoreViewRule.php
Создано системой
1.10.0