diff --git a/src/Entity/Note.php b/src/Entity/Note.php index c9f9cf5..9b7c39f 100644 --- a/src/Entity/Note.php +++ b/src/Entity/Note.php @@ -51,23 +51,22 @@ class Note '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']); + $note->fields = array_map(fn($x) => $x['value'], $noteInfo['fields']); // Set VocabKanji field - //$vocabKanji = explode('|', $fields['VocabKanji']); - $note->terms = self::parseVocabDef($fields['VocabDef']); + //$vocabKanji = explode('|', $note->fields['VocabKanji']); + $note->terms = self::parseVocabDef($note->fields['VocabDef']); // If not defined, find them from the highlighted parts in the sentence if (empty($note->terms)) { // 1. Get all spans in the text preg_match_all( self::HIGHLIGHT_PATTERN, - $fields['SentKanji'], + $note->fields['SentKanji'], $matches, PREG_SET_ORDER, ); @@ -86,7 +85,7 @@ class Note // Set to null whatever is null $readings = array_map( fn($x) => in_array($x, ['_', '_', '']) ? null : $x, - explode('|', $fields['VocabFurigana']), + explode('|', $note->fields['VocabFurigana']), ); // Set readings from furigana field