Okay, I see. First variant that I used is wrapper of that element in array that must have "UNION ALL" construction in additive array.
I mean something like: <code>$this->union[] = $all ? [$sql] : $sql;</code>. And after get it back buy construction <code>list ($union) = $union</code>. But when I wrote this code, I saw to variable params.. And I thought – maybe more good to misused params variable nor then use so non-obviously construction for this task..
I attached screenshots of this variant and that:
<code>Query.php:</code>
![2014-01-23 15 32 51](https://f.cloud.github.com/assets/3360296/1984042/4ee9549c-8422-11e3-902a-d38cbc13bf0f.png)
<code>QueryBuilder.php:</code>
![2014-01-23 15 33 38](https://f.cloud.github.com/assets/3360296/1984044/6b10e4c8-8422-11e3-913a-8980a4985a77.png)
And second variant:
<code>Query.php:</code>
![2014-01-23 15 35 58](https://f.cloud.github.com/assets/3360296/1984065/bc568518-8422-11e3-886a-d86f75c6c957.png)
<code>QueryBuilder.php</code>
![2014-01-23 15 35 18](https://f.cloud.github.com/assets/3360296/1984053/a45b0cc2-8422-11e3-91eb-6c51a1cc8d9d.png)
I think that there is exists a lot of other variant and I think that community exists exactly for that to find and use the best solution. I just suggest my solutions. Maybe I will wake up tomorrow and understand that both this solutions is very bad and suggest any new :) But today I have just two variants.
TY for comment :)