method public

BasketItemCollection::getItemById()

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

Сигнатура

public getItemById(mixed $id) : BasketItemBase|null

Параметры

$id mixed

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

BasketItemBase|null

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

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

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

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

Loader::includeModule('sale');

/** @var BasketItemCollection $object */
$id = null;
$result = $object->getItemById($id);
// $result: BasketItemBase|null

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

getItemById() есть и у других классов модуля «Интернет-магазин»: Basket, BasketBase, BasketPropertiesCollection, BasketPropertiesCollectionBase, EntityCollection, ShipmentCollection, ShipmentItemCollection, ShipmentItemStoreCollection.

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

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