I’ve been working on some refactoring of queries and got some trouble with making subqueries with TableGateway entity. Unfortunately there’s no solution for that on internets 🙁 so I had to find it by myself:
$select = new Select(); $select->columns([ 'custom_column' => new Expression('?', [ (new Select) ->...subselect query... ]) ]);
As you can see it simply works with named params. When select see Query as a part of expression, it casts it to string.
Click to rate this post!
[Total: 1 Average: 5]