CakePHP 3: How to automatically get fields from leftJoin?

I have two tables. Cars and tires. Tires can (!) Belong to the car. My tables look like this:

Tires:

id  |  car_id
-------------
1   |  17
2   |  NULL

Cars:

id  |  name
-------------
17  |  BMW
18  |  Mercedes

From my point of view, if I want to get all (!) Tires (including the car to which they belong, if it is available), I cannot create an internal connection (therefore I cannot use the one containing). I need to use a left join. But I do not know how to automatically select all the fields on the table machines.

Inquiry:

$query = $this->Tires->find('all');
$query->leftJoin(
    ['Cars' => 'cars'],
    ['Cars.id = Tires.car_id']
);

// brings this SQL query
SELECT Tires.id AS `Tires__id`, Tires.car_id AS `Tires__car_id`
FROM tires Tires 
LEFT JOIN cars Cars ON Cars.id = Tires.car_id

But how do I automatically get all the fields from cars?

UPDATE burzum actually gave me a solution that I quickly want to clarify, since I do not think it is a well-resolved cake ...

To achieve what I was trying to do, I need to add the following code:

$query
  // you need to pass each model you want to get fields for
  ->select($this->Tires)
  ->select($this->Tires->Cars);

:

...
    'Cars' => [
        'id' => '17',
        'name' => 'BMW'
    ]
...

, :

...
    'car' => object(App\Model\Entity\Car) {
        'id' => (int) 17,
        'name' => 'BMW',
        '[new]' => false,
        '[accessible]' => [
            '*' => true
        ],
        '[dirty]' => [],
        '[original]' => [],
        '[virtual]' => [],
        '[errors]' => [],
        '[invalid]' => [],
        '[repository]' => 'Cars'
    }
...

, . , ...

+4
1

http://book.cakephp.org/3.0/en/orm/query-builder.html#selecting-all-fields-from-a-table

, URL:

// Only all fields from the articles table including
// a calculated slug field.
$query = $articlesTable->find();
$query
    ->select(['slug' => $query->func()->concat(['title', '-', 'id'])])
    ->select($articlesTable); // Select all fields from articles

, select().

+3

All Articles