ankiService->getAllSentenceNoteIds(); $allNotes = $this->ankiService->getNotes($allIds); $kanjiNotes = []; foreach ($allNotes as $note) { if (!$note instanceof SentenceNote) throw new \Exception(sprintf( 'Expected SentenceNote, got %s', $note::class, )); foreach ($note->getTerms() as $term) { if (key_exists($term->getKanji(), $kanjiNotes)) continue; $newNote = new Note(); echo $note->getFields()['SentKanji']; echo '
'; echo var_export($note->getHighlightedKanji(), true); echo '

'; //echo $term->getKanji(); //echo ' | '; $kanjiNotes[$term->getKanji()] = $newNote; } } die(); } #[Route('/nonconforming', name: 'nonconforming')] public function nonconforming(): Response { $allIds = $this->ankiService->getAllNoteIds(); $allNotes = $this->ankiService->getNotes($allIds); $lacking = array_filter($allNotes, function ($note) { assert($note instanceof Note); return empty($note->getTerms()); }); return $this->render(self::tmpl('nonconforming'), [ 'notes' => $lacking, ]); } #[Route('/kanji', 'kanji', methods: 'GET')] public function kanji() { $thing = $this->ankiService->getKnownSnKanjiCounts(); asort($thing, SORT_DESC); return new Response(implode('', array_keys($thing))); } #[Route('/note/{nid}/get', name: 'get_note')] public function get_note(int $nid) { $note = $this->ankiService->getNote($nid); //$this->ankiService->updateNote($note); dd($note); } }