feat: Add rest of Anki fields to Note
This commit is contained in:
parent
230f5f18a1
commit
39e6bc9af5
|
@ -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\s+([^>]*)>(.*?)<\/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']);
|
||||
|
||||
|
|
Loading…
Reference in New Issue