method public

EntityCollection::getItemById()

Класс: \Bitrix\Sale\Internals\EntityCollection

Сигнатура

public getItemById(mixed $id) : CollectableEntity|null

Параметры

$id mixed

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

CollectableEntity|null

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

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

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

use Bitrix\Main\Loader;
use Bitrix\Sale\Internals\EntityCollection;

Loader::includeModule('sale');

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

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

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

Исходный файл: source/sale/lib/internals/entitycollection.php:175

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