Add jsonSerialize method to RelationalEntity
Signed-off-by: Julius Haertl <jus@bitgrid.net>
This commit is contained in:
committed by
Julius Härtl
parent
3324556542
commit
34c1a681b1
@@ -47,18 +47,11 @@ class Board extends RelationalEntity implements JsonSerializable {
|
||||
}
|
||||
|
||||
public function jsonSerialize() {
|
||||
$result = [
|
||||
'id' => $this->id,
|
||||
'title' => $this->title,
|
||||
'owner' => $this->owner,
|
||||
'color' => $this->color,
|
||||
'labels' => $this->labels,
|
||||
'acl' => $this->acl,
|
||||
];
|
||||
if ($this->shared !== -1) {
|
||||
$result['shared'] = $this->shared;
|
||||
$json = parent::jsonSerialize();
|
||||
if ($this->shared === -1) {
|
||||
unset($json['shared']);
|
||||
}
|
||||
return $result;
|
||||
return $json;
|
||||
}
|
||||
|
||||
public function setLabels($labels) {
|
||||
|
||||
Reference in New Issue
Block a user