viewerLogger = $viewerLogger; $this->session = $session; $this->productMetadata = $productMetadata; $this->cacheStorage = $cacheStorage; } /** * Validate if notification popup can be shown and set the notification flag * * @inheritdoc */ public function isVisible(array $arguments) { $userId = $this->session->getUser()->getId(); $cacheKey = self::$cachePrefix . $userId; $value = $this->cacheStorage->load($cacheKey); if ($value === false) { $value = version_compare( $this->viewerLogger->get($userId)->getLastViewVersion(), $this->productMetadata->getVersion(), '<' ); $this->cacheStorage->save(false, $cacheKey); } return (bool)$value; } /** * Get condition name * * @return string */ public function getName() { return self::$conditionName; } }