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 IndustrySystemCollection extends Base |
9
|
|
|
{ |
10
|
|
|
public $pageCount; |
11
|
|
|
|
12
|
|
|
public $items = []; |
13
|
|
|
|
14
|
|
|
public $totalCount; |
15
|
|
|
|
16
|
|
|
public $next; |
17
|
|
|
|
18
|
|
|
public $previous; |
19
|
|
|
|
20
|
|
|
// by Warringer\Types\Long |
21
|
|
|
public function setPageCount($pageCount) |
22
|
|
|
{ |
23
|
|
|
$this->pageCount = $pageCount; |
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
// by Warringer\Types\ArrayType |
27
|
|
|
public function setItems($items) |
28
|
|
|
{ |
29
|
|
|
// by Warringer\Types\Base |
30
|
|
|
$converters = []; |
31
|
|
|
$converters['systemCostIndices'] = function ($values) { |
32
|
|
|
// by Warringer\Types\Dict |
33
|
|
|
$converters = []; |
34
|
|
|
$converters['costIndex'] = function ($value) { return $value; }; |
35
|
|
|
$converters['activityID'] = function ($value) { return $value; }; |
36
|
|
|
$converters['activityName'] = function ($value) { return $value; }; |
37
|
|
|
|
38
|
|
|
$func = function ($value) use($converters) { |
39
|
|
|
$return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS); |
40
|
|
|
$return['costIndex'] = isset($value->{'costIndex'}) ? $converters['costIndex']($value->{'costIndex'}) : null; |
41
|
|
|
$return['activityID'] = isset($value->{'activityID'}) ? $converters['activityID']($value->{'activityID'}) : null; |
42
|
|
|
$return['activityName'] = isset($value->{'activityName'}) ? $converters['activityName']($value->{'activityName'}) : null; |
43
|
|
|
return $return; |
44
|
|
|
}; |
45
|
|
|
|
46
|
|
|
foreach ($values as $key => $value) { |
47
|
|
|
$values[$key] = $func($value); |
48
|
|
|
} |
49
|
|
|
return $values; |
50
|
|
|
}; |
51
|
|
|
|
52
|
|
|
$converters['solarSystem'] = function ($value) { return new Reference($value); }; |
53
|
|
|
|
54
|
|
|
$func = function ($value) use($converters) { |
55
|
|
|
$return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS); |
56
|
|
|
$return['systemCostIndices'] = isset($value->{'systemCostIndices'}) ? $converters['systemCostIndices']($value->{'systemCostIndices'}) : null; |
57
|
|
|
$return['solarSystem'] = isset($value->{'solarSystem'}) ? $converters['solarSystem']($value->{'solarSystem'}) : null; |
58
|
|
|
return $return; |
59
|
|
|
}; |
60
|
|
|
|
61
|
|
|
foreach ($items as $key => $value) { |
62
|
|
|
$this->items[$key] = $func($value); |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
// by Warringer\Types\Long |
67
|
|
|
public function setTotalCount($totalCount) |
68
|
|
|
{ |
69
|
|
|
$this->totalCount = $totalCount; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
// by Warringer\Types\Reference |
73
|
|
|
public function setNext($next) |
74
|
|
|
{ |
75
|
|
|
$this->next = new Reference($next); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
// by Warringer\Types\Reference |
79
|
|
|
public function setPrevious($previous) |
80
|
|
|
{ |
81
|
|
|
$this->previous = new Reference($previous); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
} |
85
|
|
|
|