Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $result = [];
- $filter = ['IBLOCK_ID' => self::IBLOCK_ID, 'ID' => (int)$id];
- $cache = Cache::createInstance();
- $cacheId = 'cvzId=' . $id;
- if($cache->initCache(self::CACHE_TIME, $cacheId, self::CACHE_PATH)) {
- $res = $cache->getVars();
- if($res && isset($res['result'])) {
- return $result;
- }
- }
- $result = ElementTable::getList(['filter' => $filter])->fetch();
- $cache->startDataCache(self::CACHE_TIME, $cacheId, self::CACHE_PATH);
- $cache->endDataCache(['result' => $result]);
- return $result;
Advertisement
Add Comment
Please, Sign In to add comment