Feat: Highlight cards with important labels

Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
This commit is contained in:
Kostiantyn Miakshyn
2025-09-07 16:58:30 +02:00
parent 4a879ab1fb
commit bbe72b93d9
14 changed files with 186 additions and 41 deletions

View File

@@ -9,6 +9,8 @@ namespace OCA\Deck\Db;
/**
* @method getTitle(): string
* @method getCustomSettings(): string
* @method setCustomSettings(string $customSettings)
*/
class Label extends RelationalEntity {
protected $title;
@@ -16,15 +18,32 @@ class Label extends RelationalEntity {
protected $boardId;
protected $cardId;
protected $lastModified;
protected $customSettings;
public function __construct() {
$this->addType('id', 'integer');
$this->addType('boardId', 'integer');
$this->addType('cardId', 'integer');
$this->addType('lastModified', 'integer');
$this->addType('customSettings', 'string');
}
public function getETag() {
return md5((string)$this->getLastModified());
}
public function getCustomSettingsArray(): array {
return $this->customSettings ? json_decode($this->customSettings, true) : [];
}
public function setCustomSettingsArray(array $customSettings): void {
$this->setCustomSettings(json_encode($customSettings ?: new \stdClass()));
}
public function jsonSerialize(): array {
$data = parent::jsonSerialize();
$data['customSettings'] = $this->getCustomSettingsArray() ?: new \stdClass();
return $data;
}
}