1 | <?php |
||
12 | class TrendResult extends Result |
||
13 | { |
||
14 | /* ----------------------------------------------------------------- |
||
15 | | Properties |
||
16 | | ----------------------------------------------------------------- |
||
17 | */ |
||
18 | |||
19 | /** |
||
20 | * The trend data of the result. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | public $trend = []; |
||
25 | |||
26 | /* ----------------------------------------------------------------- |
||
27 | | Setters |
||
28 | | ----------------------------------------------------------------- |
||
29 | */ |
||
30 | |||
31 | /** |
||
32 | * Set the latest value of the trend as the primary value. |
||
33 | * |
||
34 | * @return $this |
||
35 | */ |
||
36 | 4 | public function showLatestValue() |
|
42 | |||
43 | /** |
||
44 | * Set the trend of data for the metric. |
||
45 | * |
||
46 | * @param array $trend |
||
47 | * |
||
48 | * @return $this |
||
49 | */ |
||
50 | 44 | public function trend(array $trend) |
|
56 | |||
57 | /* ----------------------------------------------------------------- |
||
58 | | Other Methods |
||
59 | | ----------------------------------------------------------------- |
||
60 | */ |
||
61 | |||
62 | /** |
||
63 | * Get the instance as an array. |
||
64 | * |
||
65 | * @return array |
||
66 | */ |
||
67 | 8 | public function toArray(): array |
|
73 | } |
||
74 |