53 $cacheManager = Application::getInstance()->getManagedCache();
56 if ($cacheManager->read(self::CACHE_TTL, $this->cacheId))
58 $result = $cacheManager->get($this->cacheId);
62 $result = $this->getDataFromVk();
64 $cacheManager->set($this->cacheId,
$result);
90 $cacheManager = Application::getInstance()->getManagedCache();
93 if ($cacheManager->read(self::CACHE_TTL, $this->cacheId))
94 $savedData = $cacheManager->get($this->cacheId);
98 $savedData = $this->getDataFromVk();
101 $dataToSave = $savedData + $newData;
102 $cacheManager->clean($this->cacheId);
103 $cacheManager->read(self::CACHE_TTL, $this->cacheId);
104 $cacheManager->set($this->cacheId, $dataToSave);