original_string: public function search($vocabularyId)
      {
          $this->loadModel('Taxonomy.Terms');
          $out = [];
          $text = $this->request->query['q'];
          $terms = $this->Terms
              ->find()
              ->select(['id', 'name'])
              ->where(['name LIKE' => "%%{$text}%%", 'vocabulary_id' => $vocabularyId])
              ->limit(10)
              ->all();
  
          foreach ($terms as $term) {
              $out[] = ['id' => $term->id, 'name' => $term->name];
          }
  
          die(json_encode($out));
      }
code: public function search($vocabularyId)
      {
          $this->loadModel('Taxonomy.Terms');
          $out = [];
          $text = $this->request->query['q'];
          $terms = $this->Terms
              ->find()
              ->select(['id', 'name'])
              ->where(['name LIKE' => "%%{$text}%%", 'vocabulary_id' => $vocabularyId])
              ->limit(10)
              ->all();
  
          foreach ($terms as $term) {
              $out[] = ['id' => $term->id, 'name' => $term->name];
          }
  
          die(json_encode($out));
      }
code_tokens: public function search ( $ vocabularyId ) { $ this -> loadModel ( 'Taxonomy.Terms' ) ; $ out = [ ] ; $ text = $ this -> request -> query [ 'q' ] ; $ terms = $ this -> Terms -> find ( ) -> select ( [ 'id' , 'name' ] ) -> where ( [ 'name LIKE' => "%%{$text}%%" , 'vocabulary_id' => $ vocabularyId ] ) -> limit ( 10 ) -> all ( ) ; foreach ( $ terms as $ term ) { $ out [ ] = [ 'id' => $ term -> id , 'name' => $ term -> name ] ; } die ( json_encode ( $ out ) ) ; }
docstring: Shows a list of matching terms.
  
  @param int $vocabularyId Vocabulary's ID for which render its terms
  @return void
docstring_tokens: Shows a list of matching terms .