mrakolice

Results 9 comments of mrakolice

If you provide some information about it, I'll do merge request tomorrow.

``` $repository->select()->subquery([ 'myAwesomeAlias' => function(QueryBuilder $qb){ $qb->from($tableName)->columns('field1', 'field2'); } ]); SELECT myAwesomeAlias.field1, myAwesomeAlias.field2, related.* FROM ( SELECT table1.field1, table1.field2 FROM table1 WHERE table1.field3 = 'value' LIMIT 10 OFFSET 10 )...

Yeah, this is some hack issue for me, but it's works. Problem with this solution - you need to interpolate the query and manually resolve table aliases. ```php $select =...

----Update---- This behaviour exists when using LEFT_JOIN load method instead of POSTLOAD.

Is this possible when you are working with loaders, or I should use only ``select()->buildQuery()`` notation?

Can you post some usages of this API or where I can find it in source code?

``` $select = TestModel::orm()->select()->limit(10)->offset(4); TestModel::orm()->select()->from((new Fragment('(' . $select->sqlStatement() . ') as testModel')); ``` I'm finally find this solution.

``` TestModel::orm() ~ (new Orm())->getRepository(TestModel::class) ``` ``` $sqlStatement = TestModel::orm()->select()->limit(10)->offset(0)->sqlStatement(); $resultStatement = preg_replace('/\sAS\s\"c\d+\"/', '', $sqlStatement); $from = TestModel::orm()->select()->from( (new Fragment('(' . $resultStatement . ') as "' . TestModel::orm()->select()->getBuilder()->getLoader()->getAlias() . '"'))...

```php $parent = [ 'field1' => 'value' 'children' => [ ['id' => 1], ['id' => 2], ['id' => 3], ] ]; ``` All child entities exists in database, but child...