method public

BasketItemCollection::getExistsItems()

Класс: \Bitrix\Sale\BasketItemCollection

Сигнатура

public getExistsItems(string $moduleId, int $productId[, array<string|int, mixed>|null $properties = [] ]) : array<string|int, BasketItem>

Описание

Получает все элементы корзины для нужных moduleId, productId и свойств.

Параметры

$moduleId string
$productId int
$properties array<string|int, mixed>|null = []
если NULL — пропускает проверку свойств, даже если они заданы в параметрах и/или элементе корзины.

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

array<string|int, BasketItem>

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

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

Метод объекта: сначала нужен экземпляр BasketItemCollection.

use Bitrix\Main\Loader;
use Bitrix\Sale\BasketItemCollection;

Loader::includeModule('sale');

/** @var BasketItemCollection $object */
$moduleId = '';
$productId = 1;
$result = $object->getExistsItems($moduleId, $productId);
// $result: array<string|int, BasketItem>

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

getExistsItems() есть и у других классов модуля «Интернет-магазин»: Basket, BasketBase.

Исходный файл: source/sale/lib/basketitemcollection.php:187

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