Feat: Highlight cards with important labels
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user