Map stacks to VTODO and link them as parent entries

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-03-07 11:48:35 +01:00
parent fc58439d2e
commit 08097ea65f
7 changed files with 67 additions and 20 deletions

View File

@@ -23,6 +23,8 @@
namespace OCA\Deck\Db;
use Sabre\VObject\Component\VCalendar;
class Stack extends RelationalEntity {
protected $title;
protected $boardId;
@@ -50,4 +52,18 @@ class Stack extends RelationalEntity {
}
return $json;
}
public function getCalendarObject(): VCalendar {
$calendar = new VCalendar();
$event = $calendar->createComponent('VTODO');
$event->UID = 'deck-stack-' . $this->getId();
$event->SUMMARY = '[Stack]: ' . $this->getTitle();
$calendar->add($event);
return $calendar;
}
public function getCalendarPrefix(): string {
return 'stack';
}
}