title: How can I return a query object in Yii2?
body: <p>How can I return all results of <code>yii\db\Query</code> as an object from a query like this one?</p>
  
  <pre><code>$query = new Query;
  $query-&gt;select('id, name')
        -&gt;from('user')
        -&gt;limit(10);
  $rows = $query-&gt;all();
  </code></pre>