method
public
BasketItemCollection::getExistsItems()
Сигнатура
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
clearCollection()clearStartField()count()Подсчитывает количество элементов объекта.createItem()current()Возвращает текущий элемент.doFinalAction()getBasket()getBasketItems()getContext()getExistsItem()getIndexById()getItemByBasketCode()
getExistsItems() есть и у других классов модуля «Интернет-магазин»: Basket, BasketBase.
Исходный файл: source/sale/lib/basketitemcollection.php:187

