Hello, I have a simple left join between 2 tables products and brands. The basic mysql query would be this:
SELECT products.*, brands.name as brand FROM products
LEFT JOIN brands ON brands.id = products.brand_id
The query is built via query builder, hydration mode is set to array. My problem is that the result looks like this
array(1) {
["Phalcon\Models\Products"]=>
array(5) {
["id"]=>
string(1) "2"
["brand_id"]=>
string(1) "3"
["name"]=>
string(17) "Product's name"
["description"]=>
NULL
["created_at"]=>
NULL
}
["brand"]=>
string(10) "Brand name"
}
Why is join grouping the results by table names? This only happens with join. My desired result would be this:
array(6) {
["id"]=>
string(1) "2"
["brand_id"]=>
string(1) "3"
["name"]=>
string(17) "Product's name"
["description"]=>
NULL
["created_at"]=>
NULL
["brand"]=>
string(10) "Brand name"
}
Thank you!
PS: Edit: fixed the formatting