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 SovStructureCollection 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['alliance'] = function ($value) { return $value; }; |
32
|
|
|
$converters['vulnerabilityOccupancyLevel'] = function ($value) { return $value; }; |
33
|
|
|
$converters['structureID'] = function ($value) { return $value; }; |
34
|
|
|
$converters['vulnerableStartTime'] = function ($value) { return $value; }; |
35
|
|
|
$converters['solarSystem'] = function ($value) { return $value; }; |
36
|
|
|
$converters['vulnerableEndTime'] = function ($value) { return $value; }; |
37
|
|
|
$converters['type'] = function ($value) { return $value; }; |
38
|
|
|
|
39
|
|
|
$func = function ($value) use($converters) { |
40
|
|
|
$return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS); |
41
|
|
|
$return['alliance'] = isset($value->{'alliance'}) ? $converters['alliance']($value->{'alliance'}) : null; |
42
|
|
|
$return['vulnerabilityOccupancyLevel'] = isset($value->{'vulnerabilityOccupancyLevel'}) ? $converters['vulnerabilityOccupancyLevel']($value->{'vulnerabilityOccupancyLevel'}) : null; |
43
|
|
|
$return['structureID'] = isset($value->{'structureID'}) ? $converters['structureID']($value->{'structureID'}) : null; |
44
|
|
|
$return['vulnerableStartTime'] = isset($value->{'vulnerableStartTime'}) ? $converters['vulnerableStartTime']($value->{'vulnerableStartTime'}) : null; |
45
|
|
|
$return['solarSystem'] = isset($value->{'solarSystem'}) ? $converters['solarSystem']($value->{'solarSystem'}) : null; |
46
|
|
|
$return['vulnerableEndTime'] = isset($value->{'vulnerableEndTime'}) ? $converters['vulnerableEndTime']($value->{'vulnerableEndTime'}) : null; |
47
|
|
|
$return['type'] = isset($value->{'type'}) ? $converters['type']($value->{'type'}) : null; |
48
|
|
|
return $return; |
49
|
|
|
}; |
50
|
|
|
|
51
|
|
|
foreach ($items as $key => $value) { |
52
|
|
|
$this->items[$key] = $func($value); |
53
|
|
|
} |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
// by Warringer\Types\Long |
57
|
|
|
public function setTotalCount($totalCount) |
58
|
|
|
{ |
59
|
|
|
$this->totalCount = $totalCount; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
// by Warringer\Types\Reference |
63
|
|
|
public function setNext($next) |
64
|
|
|
{ |
65
|
|
|
$this->next = new Reference($next); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
// by Warringer\Types\Reference |
69
|
|
|
public function setPrevious($previous) |
70
|
|
|
{ |
71
|
|
|
$this->previous = new Reference($previous); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
} |
75
|
|
|
|