L
L
Lander2015-07-08 10:57:24
MySQL
Lander, 2015-07-08 10:57:24

Yii2 documentation discrepancy?

Good afternoon.
The official Yii2 documentation says:


leftJoin() public method
Appends a LEFT OUTER JOIN part to the query.

i write a query:
$query = new \yii\db\Query();
$query->select('data.field AS field, fields.name AS name, data.value AS value, fields.public AS public')
  ->from (['profile_fields'.' fields'])
  ->leftJoin('profile_field_data'. ' data','fields.field = data.field')
  ->where(['fields.role' => array_keys($roles), 'user_id' => $userID]);

Then I try to view the request in the debug console and get:
SELECT `data`.`field` AS `field`, `fields`.`name` AS `name`, `data`.`value` AS `value`, `fields`.`public` AS `public` FROM `profile_fields` `fields` <b>LEFT JOIN</b> `profile_field_data` `data` ON fields.field = data.field WHERE (`fields`.`role` IN ('InternalLawer', 'Superuser')) AND (`user_id`=1)

I don’t understand if it is OUTER or INNER, because the result is as if it is INNER.
Thanks in advance to those who answer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Sadovnik, 2015-07-08
@usdglander

LEFT JOIN is the same as LEFT OUTER JOIN .
You can see in the JOIN documentation that OUTER is in square brackets. This means that this keyword is optional, and the default JOIN will be OUTER .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question