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