method
public
BasketBase::getExistsItems()
Класс: \Bitrix\Sale\BasketBase
Сигнатура
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>
Как применяется в BasketBase
BasketBase::getExistsItems() — метод класса \Bitrix\Sale\BasketBase модуля «Интернет-магазин».
Метод объекта: сначала нужен экземпляр BasketBase.
use Bitrix\Main\Loader;
use Bitrix\Sale\BasketBase;
Loader::includeModule('sale');
/** @var BasketBase $object */
$moduleId = '';
$productId = 1;
$result = $object->getExistsItems($moduleId, $productId);
// $result: array<string|int, BasketItem>Другие методы BasketBase
clearCollection()clearStartField()count()Подсчитывает количество элементов объекта.create()createItem()current()Возвращает текущий элемент.deleteNoDemand()doFinalAction()getBasePrice()Получение цены корзины без скидок.getBasket()getBasketItems()getContext()
getExistsItems() есть и у других классов модуля «Интернет-магазин»: Basket, BasketItemCollection.
Исходный файл: source/sale/lib/basketbase.php:187

