1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Trello\Model; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* @codeCoverageIgnore |
7
|
|
|
*/ |
8
|
|
|
class Cardlist extends AbstractObject implements CardlistInterface |
9
|
|
|
{ |
10
|
|
|
protected $apiName = 'list'; |
11
|
|
|
|
12
|
|
|
protected $loadParams = array( |
13
|
|
|
'cards' => 'all', |
14
|
|
|
'fields' => 'all', |
15
|
|
|
); |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* {@inheritdoc} |
19
|
|
|
*/ |
20
|
|
|
public function setName($name) |
21
|
|
|
{ |
22
|
|
|
$this->data['name'] = $name; |
23
|
|
|
|
24
|
|
|
return $this; |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* {@inheritdoc} |
29
|
|
|
*/ |
30
|
|
|
public function getName() |
31
|
|
|
{ |
32
|
|
|
return $this->data['name']; |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* {@inheritdoc} |
37
|
|
|
*/ |
38
|
|
|
public function setBoardId($boardId) |
39
|
|
|
{ |
40
|
|
|
$this->data['idBoard'] = $boardId; |
41
|
|
|
|
42
|
|
|
return $this; |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* {@inheritdoc} |
47
|
|
|
*/ |
48
|
|
|
public function getBoardId() |
49
|
|
|
{ |
50
|
|
|
return $this->data['idBoard']; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* {@inheritdoc} |
55
|
|
|
*/ |
56
|
|
|
public function setBoard(BoardInterface $board) |
57
|
|
|
{ |
58
|
|
|
return $this->setBoardId($board->getId()); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* {@inheritdoc} |
63
|
|
|
*/ |
64
|
|
|
public function getBoard() |
65
|
|
|
{ |
66
|
|
|
return new Board($this->client, $this->getBoardId()); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* {@inheritdoc} |
71
|
|
|
*/ |
72
|
|
|
public function setPosition($pos) |
73
|
|
|
{ |
74
|
|
|
$this->data['pos'] = $pos; |
75
|
|
|
|
76
|
|
|
return $this; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* {@inheritdoc} |
81
|
|
|
*/ |
82
|
|
|
public function getPosition() |
83
|
|
|
{ |
84
|
|
|
return $this->data['pos']; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* {@inheritdoc} |
89
|
|
|
*/ |
90
|
|
|
public function setClosed($closed) |
91
|
|
|
{ |
92
|
|
|
$this->data['closed'] = $closed; |
93
|
|
|
|
94
|
|
|
return $this; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* {@inheritdoc} |
99
|
|
|
*/ |
100
|
|
|
public function isClosed() |
101
|
|
|
{ |
102
|
|
|
return $this->data['closed']; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* {@inheritdoc} |
107
|
|
|
*/ |
108
|
|
|
public function setSubscribed($subscribed) |
109
|
|
|
{ |
110
|
|
|
$this->data['subscribed'] = $subscribed; |
111
|
|
|
|
112
|
|
|
return $this; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* {@inheritdoc} |
117
|
|
|
*/ |
118
|
|
|
public function isSubscribed() |
119
|
|
|
{ |
120
|
|
|
return $this->data['subscribed']; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* {@inheritdoc} |
125
|
|
|
*/ |
126
|
|
|
public function getCards() |
127
|
|
|
{ |
128
|
|
|
$cards = array(); |
129
|
|
|
|
130
|
|
|
foreach ($this->data['cards'] as $card) { |
131
|
|
|
$cards[] = new Card($this->client, $card['id']); |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
return $cards; |
135
|
|
|
} |
136
|
|
|
} |
137
|
|
|
|