title: How to use YII's createCommand to also return total items?
body: <p>Let's say I do a simple query:</p>
  
  <pre><code>$products = 
   Yii::app()-&gt;db-&gt;createCommand()-&gt;setFetchMode(PDO::FETCH_OBJ)
    -&gt;select('*')
    -&gt;from('products')
    -&gt;limit(9)
    -&gt;queryAll();
  </code></pre>
  
  <p>Let's say there are 500 products in the database. Is there a way I can get YII to automatically return the total number (count) of products if the "limit" was included? Perhaps return an object like this:</p>
  
  <pre><code>$products-&gt;products = array( ... products ... )
  $products-&gt;totalProducts = 500;
  </code></pre>
  
  <p>The problem is, if LIMIT is included, it will return  items, and the count will therefore be 9. I want a solution whereby it will return the 9 items, but also the count of say 200 items if there were 200 items. </p>