| @@ -1,0 +1,46 @@ | ||
| 1 | +<?php | |
| 2 | + | |
| 3 | +declare(strict_types=1); | |
| 4 | + | |
| 5 | +namespace Metricool\Interfaces; | |
| 6 | + | |
| 7 | +interface NoticeInterface | |
| 8 | +{ | |
| 9 | + /** | |
| 10 | + * Returns the unique identifier of the notice | |
| 11 | + */ | |
| 12 | + public function getId(): string; | |
| 13 | + | |
| 14 | + /** | |
| 15 | + * Returns the version of the notice | |
| 16 | + */ | |
| 17 | + public function getVersion(): string; | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * Method is used to add a link to the UI of the notice item. | |
| 21 | + * Example (normal link): | |
| 22 | + * [ | |
| 23 | + * 'text' => 'Link text', | |
| 24 | + * 'link' => 'https://example.com' | '/services/new, | |
| 25 | + * ] | |
| 26 | + * Example (login link): | |
| 27 | + * [ | |
| 28 | + * 'text' => 'Link text', | |
| 29 | + * 'login_link' => '/v2/management/', | |
| 30 | + * ] | |
| 31 | + */ | |
| 32 | + public function getAction(): array; | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * Returns all data needed to show the notice in the UI. Keys that are | |
| 36 | + * required are 'id', 'text', 'status', 'type' and 'action'. | |
| 37 | + */ | |
| 38 | + public function toArray(): array; | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * Use this method to set the notice as active based on a server-side | |
| 42 | + * condition. By default, a notice can activate based on a client-side | |
| 43 | + * condition. | |
| 44 | + */ | |
| 45 | + public function setActive(bool $state = false): void; | |
| 46 | +} | |