_cacheFrontend = $cacheFrontend; } /** * Retrieve configuration from cache * * @param string $key * @return array|false */ public function get($key) { $data = $this->_cacheFrontend->load($this->_prefix . $key); if (!$data) { return false; } return $this->getSerializer()->unserialize($data); } /** * Save config to cache * * @param array $config * @param string $key * @return void */ public function save(array $config, $key) { $this->_cacheFrontend->save($this->getSerializer()->serialize($config), $this->_prefix . $key); } /** * Get serializer * * @return SerializerInterface * @deprecated 101.0.0 */ private function getSerializer() { if (null === $this->serializer) { $this->serializer = \Magento\Framework\App\ObjectManager::getInstance()->get(Serialize::class); } return $this->serializer; } }