1 | <?php |
||
18 | class PulseColumnStatusValue extends PulseColumnValue |
||
19 | { |
||
20 | const DEFAULT_VALUE = self::Grey; // The default color for DaPulse columns |
||
21 | |||
22 | /** |
||
23 | * The index of the orange status |
||
24 | */ |
||
25 | const Orange = 0; |
||
|
|||
26 | |||
27 | /** |
||
28 | * The index of the light green status |
||
29 | */ |
||
30 | const L_Green = 1; |
||
31 | |||
32 | /** |
||
33 | * The index of the red status |
||
34 | */ |
||
35 | const Red = 2; |
||
36 | |||
37 | /** |
||
38 | * The index of the blue status |
||
39 | */ |
||
40 | const Blue = 3; |
||
41 | |||
42 | /** |
||
43 | * The index of the purple status |
||
44 | */ |
||
45 | const Purple = 4; |
||
46 | |||
47 | /** |
||
48 | * The index of the grey status |
||
49 | */ |
||
50 | const Grey = 5; |
||
51 | const Gray = self::Grey; // just an alias |
||
52 | |||
53 | /** |
||
54 | * The index of the green status |
||
55 | */ |
||
56 | const Green = 6; |
||
57 | |||
58 | /** |
||
59 | * The index of the light blue status |
||
60 | */ |
||
61 | const L_Blue = 7; |
||
62 | |||
63 | /** |
||
64 | * The index of the gold status |
||
65 | */ |
||
66 | const Gold = 8; |
||
67 | |||
68 | /** |
||
69 | * The index of the yellow status |
||
70 | */ |
||
71 | const Yellow = 9; |
||
72 | |||
73 | /** |
||
74 | * The index of the black status |
||
75 | */ |
||
76 | const Black = 10; |
||
77 | |||
78 | /** |
||
79 | * The lowest status value that exists |
||
80 | */ |
||
81 | const MIN_VALUE = self::Orange; |
||
82 | |||
83 | /** |
||
84 | * The largest status value that exists |
||
85 | */ |
||
86 | const MAX_VALUE = self::Black; |
||
87 | |||
88 | /** |
||
89 | * Get the numerical representation of the color that a status column is set to. |
||
90 | * |
||
91 | * @api |
||
92 | * |
||
93 | * @since 0.4.0 ColumnNotFoundException is now thrown |
||
94 | * @since 0.1.0 |
||
95 | * |
||
96 | * @throws ColumnNotFoundException The specified column ID does not exist for the parent Pulse |
||
97 | * |
||
98 | * @return int The color value of a column |
||
99 | */ |
||
100 | 2 | public function getValue () |
|
104 | |||
105 | /** |
||
106 | * Update the status of a status column |
||
107 | * |
||
108 | * It is highly recommended that you use the constants available in the **PulseColumnColorValue** class to match the |
||
109 | * colors; keep in mind this value cannot be higher than 11. |
||
110 | * |
||
111 | * @api |
||
112 | * |
||
113 | * @param int $color The numerical value of the new color value |
||
114 | * |
||
115 | * @see PulseColumnStatusValue::Orange PulseColumnStatusValue::Orange |
||
116 | * @see PulseColumnStatusValue::L_Green PulseColumnStatusValue::L_Green |
||
117 | * @see PulseColumnStatusValue::Red PulseColumnStatusValue::Red |
||
118 | * @see PulseColumnStatusValue::Blue PulseColumnStatusValue::Blue |
||
119 | * @see PulseColumnStatusValue::Purple PulseColumnStatusValue::Purple |
||
120 | * @see PulseColumnStatusValue::Grey PulseColumnStatusValue::Grey |
||
121 | * @see PulseColumnStatusValue::Green PulseColumnStatusValue::Green |
||
122 | * @see PulseColumnStatusValue::L_Blue PulseColumnStatusValue::L_Blue |
||
123 | * @see PulseColumnStatusValue::Gold PulseColumnStatusValue::Gold |
||
124 | * @see PulseColumnStatusValue::Yellow PulseColumnStatusValue::Yellow |
||
125 | * @see PulseColumnStatusValue::Black PulseColumnStatusValue::Black |
||
126 | * |
||
127 | * @since 0.1.0 |
||
128 | * |
||
129 | * @throws \InvalidArgumentException if the $color is not an int or is not between 0-10 |
||
130 | */ |
||
131 | 5 | public function updateValue ($color) |
|
148 | |||
149 | /** |
||
150 | * Get the hex value of the color used on DaPulse to represent the different statuses. |
||
151 | * |
||
152 | * @api |
||
153 | * |
||
154 | * @param int $numericalValue The numerical value of the column |
||
155 | * |
||
156 | * @since 0.1.0 |
||
157 | * |
||
158 | * @return string A hex value **without** the leading # |
||
159 | */ |
||
160 | public static function getHexColor ($numericalValue) |
||
166 | |||
167 | /** |
||
168 | * Get an array of hex values for each of the statuses |
||
169 | * |
||
170 | * @api |
||
171 | * |
||
172 | * @since 0.3.1 |
||
173 | * |
||
174 | * @return array |
||
175 | */ |
||
176 | public static function getHexColors () |
||
192 | |||
193 | protected function setValue ($response) |
||
201 | } |
||
202 |