title: Yii2 construct a query with union and limit
body: <p>I need to construct an SQL query containing two queries combined by <code>UNION</code> and limit a number of rows returned.</p>
  
  <pre><code>    $query = $queryOne
          -&gt;union($queryTwo)
          -&gt;limit($this-&gt;limit)
      ;
  </code></pre>
  
  <p>The problem is that the <code>LIMIT</code> clause is enclosed in parentheses with the first query. As a result of this the second query has no <code>LIMIT</code> clause.</p>
  
  <p>I need to specify the <code>LIMIT</code> clause for the whole query not for a subquery.</p>