mirror of
https://github.com/Karaka-Management/oms-Kanban.git
synced 2026-01-11 11:28:42 +00:00
Add serialization
This commit is contained in:
parent
a2a9f79a29
commit
7b8f246480
|
|
@ -191,9 +191,29 @@ class KanbanCard implements \JsonSerializable
|
|||
|
||||
public function jsonSerialize() : array
|
||||
{
|
||||
return [];
|
||||
return [
|
||||
'title' => $this->name,
|
||||
'description' => $this->description,
|
||||
'status' => $this->status,
|
||||
'type' => $this->type,
|
||||
'column' => $this->name,
|
||||
'order' => $this->name,
|
||||
'ref' => $this->name,
|
||||
'createdBy' => $this->name,
|
||||
'createdAt' => $this->name,
|
||||
'labels' => $this->name,
|
||||
'comments' => $this->name,
|
||||
'media' => $this->name,
|
||||
];
|
||||
}
|
||||
|
||||
public static function createFromTask(Task $task) : KanbanCard
|
||||
{
|
||||
$card = new self();
|
||||
$card->setRef($task->getId());
|
||||
|
||||
return $card;
|
||||
}
|
||||
|
||||
/* todo: create function to create card from task etc... this fills the values here. what happens if task changes? bad idea! */
|
||||
/* todo: maybe allow ref to be an object and datamapper creates that object? how does the datamapper know what kind of datamapper to use? Just assume it's called ObjectMapper? bad isn't it?! */
|
||||
}
|
||||
0
Theme/Backend/kanban-card-create.tpl.php
Normal file
0
Theme/Backend/kanban-card-create.tpl.php
Normal file
Loading…
Reference in New Issue
Block a user