viewerLogger = $viewerLogger; $this->cacheStorage = $cacheStorage; } /** * Validate if notification popup can be shown and set the notification flag * * @param array $arguments Attributes from element node. * @inheritdoc */ public function isVisible(array $arguments): bool { $cacheKey = self::$cachePrefix; $value = $this->cacheStorage->load($cacheKey); if ($value !== 'log-exists') { $logExists = $this->viewerLogger->checkLogExists(); if ($logExists) { $this->cacheStorage->save('log-exists', $cacheKey); } return !$logExists; } return false; } /** * Get condition name * * @return string */ public function getName(): string { return self::$conditionName; } }