File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ class Place
12
12
13
13
public $ dueIn ;
14
14
15
+ public $ externalLabel ;
16
+
15
17
public function __construct (string $ label , string $ name )
16
18
{
17
19
$ this ->label = $ label ;
@@ -23,24 +25,33 @@ public static function make(string $label, string $name)
23
25
return new static ($ label ,$ name );
24
26
}
25
27
28
+ public function externalLabel ($ externalLabel )
29
+ {
30
+ $ this ->externalLabel = $ externalLabel ;
31
+
32
+ return $ this ;
33
+ }
34
+
26
35
public function dueIn ($ dueIn )
27
36
{
28
37
$ this ->dueIn = $ dueIn ;
38
+
29
39
return $ this ;
30
40
}
31
41
32
42
public function color ($ color )
33
43
{
34
44
$ this ->color = $ color ;
45
+
35
46
return $ this ;
36
47
}
37
48
38
49
public function toArray ()
39
50
{
40
51
return [
41
52
$ this ->name => [
42
- 'metadata ' => $ this ->metadata ()
43
- ]
53
+ 'metadata ' => $ this ->metadata (),
54
+ ],
44
55
];
45
56
}
46
57
@@ -49,7 +60,8 @@ public function metadata()
49
60
return [
50
61
'title ' => $ this ->label ,
51
62
'color ' => $ this ->color ,
52
- 'dueIn ' => $ this ->dueIn
63
+ 'dueIn ' => $ this ->dueIn ,
64
+ 'externalLabel ' => $ this ->externalLabel ,
53
65
];
54
66
}
55
67
}
Original file line number Diff line number Diff line change @@ -146,7 +146,9 @@ public function getPlace($place)
146
146
return [
147
147
'name ' => $ place ,
148
148
'title ' => $ meta ['title ' ],
149
- 'color ' => $ meta ['color ' ]
149
+ 'color ' => $ meta ['color ' ],
150
+ 'externalLabel ' => $ meta ['externalLabel ' ] ?? $ meta ['title ' ],
151
+ 'externalColor ' => $ meta ['externalColor ' ] ?? $ meta ['color ' ],
150
152
];
151
153
}
152
154
You can’t perform that action at this time.
0 commit comments