|
1
|
|
|
<?php |
|
2
|
|
|
namespace Perry\Representation\Eve\v1; |
|
3
|
|
|
|
|
4
|
|
|
use \Perry\Representation\Reference as Reference; |
|
5
|
|
|
use \Perry\Representation\Uri as Uri; |
|
6
|
|
|
use \Perry\Representation\Base as Base; |
|
7
|
|
|
|
|
8
|
|
|
class Region extends Base |
|
9
|
|
|
{ |
|
10
|
|
|
public $description; |
|
11
|
|
|
|
|
12
|
|
|
public $marketBuyOrders; |
|
13
|
|
|
|
|
14
|
|
|
public $name; |
|
15
|
|
|
|
|
16
|
|
|
public $constellations = []; |
|
17
|
|
|
|
|
18
|
|
|
public $marketSellOrders; |
|
19
|
|
|
|
|
20
|
|
|
// by Warringer\Types\String |
|
21
|
|
|
public function setDescription($description) |
|
22
|
|
|
{ |
|
23
|
|
|
$this->description = $description; |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
// by Warringer\Types\Reference |
|
27
|
|
|
public function setMarketBuyOrders($marketBuyOrders) |
|
28
|
|
|
{ |
|
29
|
|
|
$this->marketBuyOrders = new Reference($marketBuyOrders); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
// by Warringer\Types\String |
|
33
|
|
|
public function setName($name) |
|
34
|
|
|
{ |
|
35
|
|
|
$this->name = $name; |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
// by Warringer\Types\ArrayType |
|
39
|
|
|
public function setConstellations($constellations) |
|
40
|
|
|
{ |
|
41
|
|
|
// by Warringer\Types\Dict |
|
42
|
|
|
$converters = []; |
|
43
|
|
|
$converters['href'] = function ($value) { return new Uri($value); }; |
|
44
|
|
|
|
|
45
|
|
|
$func = function ($value) use($converters) { |
|
46
|
|
|
$return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS); |
|
47
|
|
|
$return['href'] = isset($value->{'href'}) ? $converters['href']($value->{'href'}) : null; |
|
48
|
|
|
return $return; |
|
49
|
|
|
}; |
|
50
|
|
|
|
|
51
|
|
|
foreach ($constellations as $key => $value) { |
|
52
|
|
|
$this->constellations[$key] = $func($value); |
|
53
|
|
|
} |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
// by Warringer\Types\Reference |
|
57
|
|
|
public function setMarketSellOrders($marketSellOrders) |
|
58
|
|
|
{ |
|
59
|
|
|
$this->marketSellOrders = new Reference($marketSellOrders); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
} |
|
63
|
|
|
|