active = $state; } /** * Override this method to set the notice as active based on a server-side * condition. By default, the notice is not active. */ public function isActive(): bool { return $this->active ?? false; } /** * @inheritDoc */ public function getId(): string { return static::IDENTIFIER; } /** * @inheritDoc */ public function getVersion(): string { return $this->version ?? '1.0.0'; } /** * @inheritDoc */ public function getAction(): array { return []; } /** * Use this method to set the type of notice. By default, the type is * 'info' but you can override this method to set the type according to your * needs. */ public function getType(): string { return self::TYPE_INFO; } /** * Reads if the Notice is premium */ public function isPremium(): bool { return $this->premium ?? false; } /** * @inheritDoc */ public function toArray(): array { return [ 'id' => $this->getId(), 'active' => $this->isActive(), 'title' => $this->getTitle(), 'text' => $this->getText(), 'premium' => $this->isPremium(), 'type' => $this->getType(), 'route' => $this->getRoute(), 'action' => $this->getAction(), ]; } }