original_string: protected function insertWords()
      {
          try {
              $vocabulary = [];
              $allWords = $this->prepareWords();
              $this->addNewWords($allWords);
              $query = (new Query())->from(Vocabulary::tableName())->where(['word' => $allWords]);
              foreach ($query->each() as $vocabularyNew) {
                  $vocabulary[] = [$vocabularyNew['id'], $this->id];
              }
              if (!empty($vocabulary)) {
                  if (!Podium::getInstance()->db->createCommand()->batchInsert(
                          '{{%podium_vocabulary_junction}}', ['word_id', 'post_id'], $vocabulary
                      )->execute()) {
                      throw new Exception('Words connections saving error!');
                  }
              }
          } catch (Exception $e) {
              Log::error($e->getMessage(), null, __METHOD__);
              throw $e;
          }
      }
code: protected function insertWords()
      {
          try {
              $vocabulary = [];
              $allWords = $this->prepareWords();
              $this->addNewWords($allWords);
              $query = (new Query())->from(Vocabulary::tableName())->where(['word' => $allWords]);
              foreach ($query->each() as $vocabularyNew) {
                  $vocabulary[] = [$vocabularyNew['id'], $this->id];
              }
              if (!empty($vocabulary)) {
                  if (!Podium::getInstance()->db->createCommand()->batchInsert(
                          '{{%podium_vocabulary_junction}}', ['word_id', 'post_id'], $vocabulary
                      )->execute()) {
                      throw new Exception('Words connections saving error!');
                  }
              }
          } catch (Exception $e) {
              Log::error($e->getMessage(), null, __METHOD__);
              throw $e;
          }
      }
code_tokens: protected function insertWords ( ) { try { $ vocabulary = [ ] ; $ allWords = $ this -> prepareWords ( ) ; $ this -> addNewWords ( $ allWords ) ; $ query = ( new Query ( ) ) -> from ( Vocabulary :: tableName ( ) ) -> where ( [ 'word' => $ allWords ] ) ; foreach ( $ query -> each ( ) as $ vocabularyNew ) { $ vocabulary [ ] = [ $ vocabularyNew [ 'id' ] , $ this -> id ] ; } if ( ! empty ( $ vocabulary ) ) { if ( ! Podium :: getInstance ( ) -> db -> createCommand ( ) -> batchInsert ( '{{%podium_vocabulary_junction}}' , [ 'word_id' , 'post_id' ] , $ vocabulary ) -> execute ( ) ) { throw new Exception ( 'Words connections saving error!' ) ; } } } catch ( Exception $ e ) { Log :: error ( $ e -> getMessage ( ) , null , __METHOD__ ) ; throw $ e ; } }
docstring: Inserts tag words.
  @throws Exception
docstring_tokens: Inserts tag words .