S
S
sergeyviktorovich2020-01-02 14:17:29
1C-Bitrix
sergeyviktorovich, 2020-01-02 14:17:29

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

1 answer(s)
A
Alexey Emelyanov, 2020-01-02
@babarun

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();

Here everything is well painted https://mrcappuccino.ru/blog/post/iblock-elements-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question