method public

BasketItemCollection::createItem()

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

Сигнатура

public createItem(mixed $moduleId, mixed $productId[, null $basketCode = null ]) : BasketItemBase

Параметры

$moduleId mixed
$productId mixed
$basketCode null = null

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

BasketItemBase

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

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

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

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

Loader::includeModule('sale');

/** @var BasketItemCollection $object */
$moduleId = null;
$productId = null;
$result = $object->createItem($moduleId, $productId);
// $result: BasketItemBase

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

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

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

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