Fix stack renaming, archived card adding

This commit is contained in:
Julius Haertl
2016-10-28 01:59:59 +02:00
parent 5e7f0a044d
commit 461269d7d2
6 changed files with 30 additions and 16 deletions

View File

@@ -34,22 +34,34 @@ class Stack extends Entity implements JsonSerializable {
protected $boardId;
protected $cards = array();
protected $order;
public function __construct() {
$this->addType('id','integer');
$this->addType('boardId','integer');
$this->addType('order','integer');
}
public function setCards($cards) {
$this->cards = $cards;
}
public function jsonSerialize() {
return [
'id' => $this->id,
'title' => $this->title,
'order' => $this->order,
'boardId' => $this->boardId,
'cards' => $this->cards,
];
if(!empty($this->cards)) {
return [
'id' => $this->id,
'title' => $this->title,
'order' => $this->order,
'boardId' => $this->boardId,
'cards' => $this->cards
];
} else {
return [
'id' => $this->id,
'title' => $this->title,
'order' => $this->order,
'boardId' => $this->boardId
];
}
}
}