method
public
EntityCollection::getIndexById()
Сигнатура
public getIndexById(mixed $id) : bool|int|null
Параметры
$id
mixed
Возвращаемое значение
bool|int|null
Как применяется в EntityCollection
EntityCollection::getIndexById() — метод класса \Bitrix\Sale\Internals\EntityCollection модуля «Интернет-магазин».
Метод объекта: сначала нужен экземпляр EntityCollection.
use Bitrix\Main\Loader;
use Bitrix\Sale\Internals\EntityCollection;
Loader::includeModule('sale');
/** @var EntityCollection $object */
$id = null;
$result = $object->getIndexById($id);
// $result: bool|int|nullДругие методы EntityCollection
clearCollection()clearStartField()count()Подсчитывает количество элементов объекта.current()Возвращает текущий элемент.doFinalAction()getItemById()getItemByIndex()getIterator()getRegistryType()hasMeaningfulField()isAnyItemAdded()isAnyItemDeleted()
getIndexById() есть и у других классов модуля «Интернет-магазин»: Basket, BasketBase, BasketItemCollection, BasketPropertiesCollection, BasketPropertiesCollectionBase, ShipmentCollection, ShipmentItemCollection, ShipmentItemStoreCollection.
Исходный файл: source/sale/lib/internals/entitycollection.php:203

