storeManager = $context->getStoreManager(); $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class); } /** * Return id of current website * * Can be used when necessary to obtain website id of the current customer. * * @return integer * @since 100.1.9 */ public function getWebsiteId() { return (int)$this->_storeManager->getStore()->getWebsiteId(); } /** * Encode invalidation rules. * * @param array $configuration * @return bool|string * @throws \InvalidArgumentException * @since 102.0.0 */ public function encodeConfiguration(array $configuration) { return $this->serializer->serialize($configuration); } }