method public static

ByPrice::checkByEntity()

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

Сигнатура

public static checkByEntity(Entity $shipment, array<string|int, mixed> $restrictionParams, mixed $mode[, mixed $deliveryId = 0 ]) : int

Описание

Проверка параметров службы на соответствие ограничению по сущности.

Параметры

$shipment Entity
$restrictionParams array<string|int, mixed>
$mode mixed
$deliveryId mixed = 0

Возвращаемое значение

int

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

ByPrice::checkByEntity() — метод класса \Bitrix\Sale\Delivery\Restrictions\ByPrice модуля «Интернет-магазин». ByPrice: Класс ByWeight Ограничивает доставку по весу.

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

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

Loader::includeModule('sale');

$shipment = null; // Entity
$restrictionParams = [];
$mode = null;
$result = ByPrice::checkByEntity($shipment, $restrictionParams, $mode);
// $result: int

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

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

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

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