diff --git a/src/Command/CreateProductionCommand.php b/src/Command/CreateProductionCommand.php index 61c9754..b0f4c80 100644 --- a/src/Command/CreateProductionCommand.php +++ b/src/Command/CreateProductionCommand.php @@ -89,30 +89,10 @@ class CreateProductionCommand extends Command } } - /** @return list */ - private function getAllSentenceNotes(): array - { - printf('Getting all SentenceNote...'); - $allIds = $this->ankiService->getAllSentenceNoteIds(); - $allNotes = $this->ankiService->getNotes($allIds); - printf(" OK (%d)\n", count($allNotes)); - return $allNotes; - } - - /** @return list */ - private function getAllSentenceListeningNotes(): array - { - printf('Getting all SentenceListeningNote...'); - $allListeningIds = $this->ankiService->getAllSentenceListeningNoteIds(); - $allListeningNotes = $this->ankiService->getNotes($allListeningIds); - printf(" OK (%d)\n", count($allListeningNotes)); - return $allListeningNotes; - } - protected function execute(InputInterface $input, OutputInterface $output): int { - $allSentenceNotes = $this->getAllSentenceNotes(); - $allListeningNotes = $this->getAllSentenceListeningNotes(); + $allSentenceNotes = $this->ankiService->getAllFromClass(SentenceNote::class, false); + $allListeningNotes = $this->ankiService->getAllFromClass(SentenceListeningNote::class, false); // Index of all the Terms indexed by its TermKanji $allTerms = []; // ["パレートの法則" => App\Entity\Term] diff --git a/src/Entity/SentenceNote.php b/src/Entity/SentenceNote.php index 9571b72..3bb3401 100644 --- a/src/Entity/SentenceNote.php +++ b/src/Entity/SentenceNote.php @@ -5,6 +5,7 @@ namespace App\Entity; class SentenceNote extends Note { const MODEL_NAME = 'Japanese sentences'; + const DECK = '日本語::音読'; private ?array $mediaInfo = []; private array $terms = [];