method public static

Base::checkByEntity()

Класс: \Bitrix\Sale\Delivery\Restrictions\Base

Сигнатура

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

Как применяется в Base

Base::checkByEntity() — метод класса \Bitrix\Sale\Delivery\Restrictions\Base модуля «Интернет-магазин».

Статический метод — вызывается через имя класса Base, без создания объекта.

use Bitrix\Main\Loader;
use Bitrix\Sale\Delivery\Restrictions\Base;

Loader::includeModule('sale');

$entity = null; // Entity
$restrictionParams = [];
$mode = 1;
$result = Base::checkByEntity($entity, $restrictionParams, $mode);
// $result: int

Другие методы Base

checkByEntity() есть и у других классов модуля «Интернет-магазин»: ByConcreteProduct, ByDimensions, ByLocation, ByMaxSize, ByPaySystem, ByPersonType, ByPrice, ByProductCategory.

Исходный файл: source/sale/lib/delivery/restrictions/base.php:84

Что будем искать? Например,Продвижение