-
Notifications
You must be signed in to change notification settings - Fork 611
/
Statusable.php
38 lines (35 loc) · 1012 Bytes
/
Statusable.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* @link https://craftcms.com/
* @copyright Copyright (c) Pixel & Tonic, Inc.
* @license https://craftcms.github.io/license/
*/
namespace craft\base;
/**
* Statusable defines the common interface to be implemented by components that
* can have statuses within the control panel.
*
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
* @since 5.0.0
*/
interface Statusable
{
/**
* Returns all the possible statuses that components may have.
*
* It should return an array whose keys are the status values, and values are the human-facing status labels, or an array
* with the following keys:
*
* - **`label`** – The human-facing status label.
* - **`color`** – The status color. See [[craft\enums\Color]] for possible values.
*
* @return array
*/
public static function statuses(): array;
/**
* Returns the component’s status.
*
* @return string|null
*/
public function getStatus(): ?string;
}