Cake\Database\Query::leftJoin PHP Метод

leftJoin() публичный Метод

This is a shorthand method for building joins via join(). The table name can be passed as a string, or as an array in case it needs to be aliased: LEFT JOIN authors ON authors.id = posts.author_id $query->leftJoin('authors', 'authors.id = posts.author_id'); LEFT JOIN authors a ON a.id = posts.author_id $query->leftJoin(['a' => 'authors'], 'a.id = posts.author_id'); Conditions can be passed as strings, arrays, or expression objects. When using arrays it is possible to combine them with the $types parameter in order to define how to convert the values: $query->leftJoin(['a' => 'articles'], [ 'a.posted >=' => new DateTime('-3 days'), 'a.published' => true, 'a.author_id = authors.id' ], ['a.posted' => 'datetime', 'a.published' => 'boolean']); See join() for further details on conditions and types.
public leftJoin ( string | array $table, string | array | Cake\Database\ExpressionInterface $conditions = [], array $types = [] )
$table string | array The table to join with
$conditions string | array | Cake\Database\ExpressionInterface The conditions to use for joining.
$types array a list of types associated to the conditions used for converting values to the corresponding database representation.
    public function leftJoin($table, $conditions = [], $types = [])
    {
        return $this->join($this->_makeJoin($table, $conditions, 'LEFT'), $types);
    }