$query = $this->createQueryBuilder('p');
$query
->select('s', 'p')
->innerJoin(
'test\Entity\ProductQuantity',
's',
\Doctrine\ORM\Query\Expr\Join::WITH,
'p.sku = s.sku'
)
->orderBy('p.productId', 'DESC');
return $query->getQuery()->getResult();
This query must return result of 2 tables, what I get:
result = array(
[0] => 'table1',
[1]=> 'table2',
[2] => 'table1',
[3]=> 'table2',
)
Why I'm get 2 tables in 2 arrays ? this is join query and it must be in 1 array, how to merge result of join query in 1 array and get:
result = array(
[0] => 'table1table2',
[1] => 'table1table2',
)
You can get result as a an array by using :
$query->getQuery()->getScalarResult();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With