title: Yii2: get raw sql of model->save()
body: <p>I want to add record to a table with <code>ActiveRecord</code>.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>$model = new Article();
  $model-&gt;title = 'test title';
  $model-&gt;content = 'test content';
  $model-&gt;category_id = 1;
  $model-&gt;author_id = 1;
  if ($model-&gt;validate()) {
      $model-&gt;save();
  }
  </code></pre>
  
  <p><code>$model-&gt;validate()</code> returns <code>true</code>, but <code>$model-&gt;save()</code> returns <code>false</code>.</p>
  
  <p>How to find generated raw sql of <code>$model-&gt;save()</code>?</p>
  
  <p>Meanwhile: </p>
  
  <p><code>$model-&gt;save()-&gt;rawSql</code> is <code>null</code> and <code>$model-&gt;getErrors()</code> returns empty array.</p>
  
  <p>In debug, all queries are logged, but I did not find any insert or update query.</p>