method
public
BasketItemCollection::getItemByBasketCode()
Сигнатура
public getItemByBasketCode(mixed $code) : BasketItemBase|null
Параметры
$code
mixed
Возвращаемое значение
BasketItemBase|null
Как применяется в BasketItemCollection
BasketItemCollection::getItemByBasketCode() — метод класса \Bitrix\Sale\BasketItemCollection модуля «Интернет-магазин».
Метод объекта: сначала нужен экземпляр BasketItemCollection.
use Bitrix\Main\Loader;
use Bitrix\Sale\BasketItemCollection;
Loader::includeModule('sale');
/** @var BasketItemCollection $object */
$code = null;
$result = $object->getItemByBasketCode($code);
// $result: BasketItemBase|nullДругие методы BasketItemCollection
clearCollection()clearStartField()count()Подсчитывает количество элементов объекта.createItem()current()Возвращает текущий элемент.doFinalAction()getBasket()getBasketItems()getContext()getExistsItem()getExistsItems()Получает все элементы корзины для нужных moduleId, productId и свойств.getIndexById()
getItemByBasketCode() есть и у других классов модуля «Интернет-магазин»: Basket, BasketBase, ShipmentItemCollection.
Исходный файл: source/sale/lib/basketitemcollection.php:106

