Answer the question
In order to leave comments, you need to log in
How is the cached method for getting a list of infoblock elements implemented?
How to create a php class for working with infoblocks, which will implement a cached method for getting a list of infoblock elements. The method must be flexible (the ability to set sorting, filter, list of selectable fields when calling the method)
Answer the question
In order to leave comments, you need to log in
No need to write anything, use ready-made classes:
$element = \Bitrix\Iblock\Elements\ElementCatalogTable::getList([
'select' => ['ID', 'NAME'],
'filter' => [
'ID' => $elementId,
],
"cache" => ["ttl" => 3600],
])->fetchObject();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question