title: Batch Insert data into database using web services in yii2 error
body: <p>I've tried for get data in web services at <a href="http://api.rajaongkir.com/dokumentasi/starter" rel="nofollow noreferrer">http://api.rajaongkir.com/dokumentasi/starter</a>. And I was success show data in view browser. When I implementation for insert data with a lot of into database something any wrong. I don't know why.   </p>
  
  <p>This code for get data in web service at <a href="http://api.rajaongkir.com/dokumentasi/starter" rel="nofollow noreferrer">http://api.rajaongkir.com/dokumentasi/starter</a>. And put in controllers/TestController.php</p>
  
  <pre><code>public function actionGetProvince($id=0)
      {
          $client = new client();
          $addUrl = ($id&gt;0)?'id='.$id:'';
          $response = $client-&gt;createRequest()
                      -&gt;setFormat(Client::FORMAT_JSON)
                      -&gt;setMethod('get')
                      -&gt;setUrl('http://api.rajaongkir.com/starter/province?'.$addUrl)
                      -&gt;addHeaders(['key' =&gt; 'example'])
                      -&gt;send();
          if ($response-&gt;isOk) {
              $content = \Yii\helpers\Json::decode($response-&gt;content);
              //$content['rajaongkir']['query']
              //$content['rajaongkir']['status']
              $results = $content['rajaongkir']['results'];
              if ($id &gt; 0) {
                  if (count($results)&gt;0) {
                      echo $results['province_id'] . ' - ';
                      echo $results['province'] . '&lt;br&gt;';
                  }
                  else {
                      echo "blank";
                  }
              } else {
                  foreach ($results as $provinces) {
                      echo $provinces['province_id']." - ".$provinces['province']."&lt;br&gt;";
                  }
              }
          } else {
              $content = \Yii\helpers\Json::decode($response-&gt;content);
              echo $content['rajaongkir']['status']['description'];
          }
      }
  </code></pre>
  
  <p>And this code for insert data with a lot of in database, and I put in file same.</p>
  
  <pre><code>Yii::$app-&gt;db-&gt;createCommand()-&gt;batchInsert('province', [
              'id_province' =&gt; $provinces['province_id'], 'name' =&gt; $provinces['province']
              ])-&gt;execute(); 
  </code></pre>
  
  <p>And the result error is : </p>
  
  <blockquote>
    <p>PHP Warning – yii\base\ErrorException : Missing argument 3 for yii\db\Command::batchInsert(), called in C:\wamp\www\basic_yii2\controllers\TestController.php on line 60 and defined</p>
  </blockquote>