From 39e6bc9af558831959612f181a2fea7ec033631a Mon Sep 17 00:00:00 2001 From: Dendy Faist Date: Thu, 6 Feb 2025 15:56:28 +0900 Subject: [PATCH] feat: Add rest of Anki fields to Note --- src/Entity/Note.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Entity/Note.php b/src/Entity/Note.php index 3d902bf..f3cd693 100644 --- a/src/Entity/Note.php +++ b/src/Entity/Note.php @@ -15,6 +15,13 @@ class Note private int $id; private int $mod; private array $terms = []; + private string $profile; + private array $tags = []; + private string $model; + // Maybe these doesn't make sense to keep but leaving it here just in + // case for handiness' sake + private array $fields = []; + private array $cardIds; const HIGHLIGHT_PATTERN = '/]*)>(.*?)<\/span>/i'; const HIGHLIGHT_ATTR_KANJI = 'style="color: rgb(255, 78, 8);"'; @@ -39,7 +46,15 @@ class Note { $note = new self(); - ['noteId' => $note->id, 'mod' => $note->mod] = $noteInfo; + [ + 'noteId' => $note->id, + 'mod' => $note->mod, + 'profile' => $note->profile, + 'tags' => $note->tags, + 'fields' => $note->fields, + 'modelName' => $note->model, + 'cards' => $note->cardIds, + ] = $noteInfo; $fields = array_map(fn($x) => $x['value'], $noteInfo['fields']);