|
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 TournamentMatchCollection 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['winner'] = function ($value) { return new Reference($value); }; |
|
32
|
|
|
$converters['stats'] = function ($value) { return $value; }; |
|
33
|
|
|
$converters['redTeam'] = function ($value) { return new Reference($value); }; |
|
34
|
|
|
$converters['bans'] = function ($value) { return $value; }; |
|
35
|
|
|
$converters['finalized'] = function ($value) { return $value; }; |
|
36
|
|
|
$converters['series'] = function ($value) { return new Reference($value); }; |
|
37
|
|
|
$converters['tournament'] = function ($value) { return new Reference($value); }; |
|
38
|
|
|
$converters['staticSceneData'] = function ($value) { return new Reference($value); }; |
|
39
|
|
|
$converters['firstReplayFrame'] = function ($value) { return new Reference($value); }; |
|
40
|
|
|
$converters['lastReplayFrame'] = function ($value) { return new Reference($value); }; |
|
41
|
|
|
$converters['blueTeam'] = function ($value) { return new Reference($value); }; |
|
42
|
|
|
$converters['inProgress'] = function ($value) { return $value; }; |
|
43
|
|
|
$converters['score'] = function ($value) { return $value; }; |
|
44
|
|
|
|
|
45
|
|
|
$func = function ($value) use($converters) { |
|
46
|
|
|
$return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS); |
|
47
|
|
|
$return['winner'] = isset($value->{'winner'}) ? $converters['winner']($value->{'winner'}) : null; |
|
48
|
|
|
$return['stats'] = isset($value->{'stats'}) ? $converters['stats']($value->{'stats'}) : null; |
|
49
|
|
|
$return['redTeam'] = isset($value->{'redTeam'}) ? $converters['redTeam']($value->{'redTeam'}) : null; |
|
50
|
|
|
$return['bans'] = isset($value->{'bans'}) ? $converters['bans']($value->{'bans'}) : null; |
|
51
|
|
|
$return['finalized'] = isset($value->{'finalized'}) ? $converters['finalized']($value->{'finalized'}) : null; |
|
52
|
|
|
$return['series'] = isset($value->{'series'}) ? $converters['series']($value->{'series'}) : null; |
|
53
|
|
|
$return['tournament'] = isset($value->{'tournament'}) ? $converters['tournament']($value->{'tournament'}) : null; |
|
54
|
|
|
$return['staticSceneData'] = isset($value->{'staticSceneData'}) ? $converters['staticSceneData']($value->{'staticSceneData'}) : null; |
|
55
|
|
|
$return['firstReplayFrame'] = isset($value->{'firstReplayFrame'}) ? $converters['firstReplayFrame']($value->{'firstReplayFrame'}) : null; |
|
56
|
|
|
$return['lastReplayFrame'] = isset($value->{'lastReplayFrame'}) ? $converters['lastReplayFrame']($value->{'lastReplayFrame'}) : null; |
|
57
|
|
|
$return['blueTeam'] = isset($value->{'blueTeam'}) ? $converters['blueTeam']($value->{'blueTeam'}) : null; |
|
58
|
|
|
$return['inProgress'] = isset($value->{'inProgress'}) ? $converters['inProgress']($value->{'inProgress'}) : null; |
|
59
|
|
|
$return['score'] = isset($value->{'score'}) ? $converters['score']($value->{'score'}) : null; |
|
60
|
|
|
return $return; |
|
61
|
|
|
}; |
|
62
|
|
|
|
|
63
|
|
|
foreach ($items as $key => $value) { |
|
64
|
|
|
$this->items[$key] = $func($value); |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
// by Warringer\Types\Long |
|
69
|
|
|
public function setTotalCount($totalCount) |
|
70
|
|
|
{ |
|
71
|
|
|
$this->totalCount = $totalCount; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
// by Warringer\Types\Reference |
|
75
|
|
|
public function setNext($next) |
|
76
|
|
|
{ |
|
77
|
|
|
$this->next = new Reference($next); |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
// by Warringer\Types\Reference |
|
81
|
|
|
public function setPrevious($previous) |
|
82
|
|
|
{ |
|
83
|
|
|
$this->previous = new Reference($previous); |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
} |
|
87
|
|
|
|