method
public
static
TradeBinding::checkByEntity()
Класс: \Bitrix\Sale\Services\PaySystem\Restrictions\TradeBinding
Сигнатура
public static checkByEntity(Entity $entity, array<string|int, mixed> $restrictionParams, int $mode[, int $serviceId = 0 ]) : int
Описание
Проверка параметров службы на соответствие ограничению по сущности.
Параметры
$entity
Entity
$restrictionParams
array<string|int, mixed>
$mode
int
$serviceId
int
= 0
Возвращаемое значение
int
Как применяется в TradeBinding
TradeBinding::checkByEntity() — метод класса \Bitrix\Sale\Services\PaySystem\Restrictions\TradeBinding модуля «Интернет-магазин».
Статический метод — вызывается через имя класса TradeBinding, без создания объекта.
use Bitrix\Main\Loader;
use Bitrix\Sale\Services\PaySystem\Restrictions\TradeBinding;
Loader::includeModule('sale');
$entity = null; // Entity
$restrictionParams = [];
$mode = 1;
$result = TradeBinding::checkByEntity($entity, $restrictionParams, $mode);
// $result: intДругие методы TradeBinding
check()Проверка параметров службы на соответствие ограничению.delete()getClassDescription()getClassTitle()getCode()Получить код ограничения, сопоставимый с кодом ограничения обработчика службы.getOnApplyErrorMessage()Возвращает сообщение, которое отображается при возникновении ошибки во время применения ограниченияgetParamsStructure()Возвращает структуру параметров для отображения пользователюgetSeverity()isAvailable()isMyCode()prepareData()prepareParamsValues()
checkByEntity() есть и у других классов модуля «Интернет-магазин»: Base, ByConcreteProduct, ByDimensions, ByLocation, ByMaxSize, ByPaySystem, ByPersonType, ByPrice.
Исходный файл: source/sale/lib/services/paysystem/restrictions/tradebinding.php:84

