public function actionVocFlushTerms($voc_id) { $voc = SpecTermsVoc::findOne(['id' => $voc_id]); if (empty($voc)) { echo "Vocabulary with id {$voc_id} not exists\n"; return; } $yes = $this->prompt("Are you sure you want to remove all terms from vocabulary {$voc->name} id: {$voc->id} ? Type 'yes' to proceed \n"); if ($yes == 'yes') { SpecTerm::deleteAll(['vocabulary_id' => $voc_id]); echo "All terms for vocabulary id: {$voc_id} has been removed\n"; } }