mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 13:58:55 +08:00
Document [alias=>table] syntax for join methods (#17967)
This commit is contained in:
@ -921,16 +921,18 @@ PATTERN;
|
|||||||
* Appends a JOIN part to the query.
|
* Appends a JOIN part to the query.
|
||||||
* The first parameter specifies what type of join it is.
|
* The first parameter specifies what type of join it is.
|
||||||
* @param string $type the type of join, such as INNER JOIN, LEFT JOIN.
|
* @param string $type the type of join, such as INNER JOIN, LEFT JOIN.
|
||||||
* @param string|array $table the table to be joined.
|
* @param string|array $table the table or sub-query to be joined.
|
||||||
*
|
*
|
||||||
* Use a string to represent the name of the table to be joined.
|
* Use a string to represent the name of the table to be joined.
|
||||||
* The table name can contain a schema prefix (e.g. 'public.user') and/or table alias (e.g. 'user u').
|
* The table name can contain a schema prefix (e.g. 'public.user') and/or table alias (e.g. 'user u').
|
||||||
* The method will automatically quote the table name unless it contains some parenthesis
|
* The method will automatically quote the table name unless it contains some parenthesis
|
||||||
* (which means the table is given as a sub-query or DB expression).
|
* (which means the table is given as a sub-query or DB expression).
|
||||||
*
|
*
|
||||||
* Use an array to represent joining with a sub-query. The array must contain only one element.
|
* You may also specify the table as an array with one element, using the array key as the table alias
|
||||||
* The value must be a [[Query]] object representing the sub-query while the corresponding key
|
* (e.g. ['u' => 'user']).
|
||||||
* represents the alias for the sub-query.
|
*
|
||||||
|
* To join a sub-query, use an array with one element, with the value set to a [[Query]] object
|
||||||
|
* representing the sub-query, and the corresponding key representing the alias.
|
||||||
*
|
*
|
||||||
* @param string|array $on the join condition that should appear in the ON part.
|
* @param string|array $on the join condition that should appear in the ON part.
|
||||||
* Please refer to [[where()]] on how to specify this parameter.
|
* Please refer to [[where()]] on how to specify this parameter.
|
||||||
@ -955,16 +957,18 @@ PATTERN;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Appends an INNER JOIN part to the query.
|
* Appends an INNER JOIN part to the query.
|
||||||
* @param string|array $table the table to be joined.
|
* @param string|array $table the table or sub-query to be joined.
|
||||||
*
|
*
|
||||||
* Use a string to represent the name of the table to be joined.
|
* Use a string to represent the name of the table to be joined.
|
||||||
* The table name can contain a schema prefix (e.g. 'public.user') and/or table alias (e.g. 'user u').
|
* The table name can contain a schema prefix (e.g. 'public.user') and/or table alias (e.g. 'user u').
|
||||||
* The method will automatically quote the table name unless it contains some parenthesis
|
* The method will automatically quote the table name unless it contains some parenthesis
|
||||||
* (which means the table is given as a sub-query or DB expression).
|
* (which means the table is given as a sub-query or DB expression).
|
||||||
*
|
*
|
||||||
* Use an array to represent joining with a sub-query. The array must contain only one element.
|
* You may also specify the table as an array with one element, using the array key as the table alias
|
||||||
* The value must be a [[Query]] object representing the sub-query while the corresponding key
|
* (e.g. ['u' => 'user']).
|
||||||
* represents the alias for the sub-query.
|
*
|
||||||
|
* To join a sub-query, use an array with one element, with the value set to a [[Query]] object
|
||||||
|
* representing the sub-query, and the corresponding key representing the alias.
|
||||||
*
|
*
|
||||||
* @param string|array $on the join condition that should appear in the ON part.
|
* @param string|array $on the join condition that should appear in the ON part.
|
||||||
* Please refer to [[join()]] on how to specify this parameter.
|
* Please refer to [[join()]] on how to specify this parameter.
|
||||||
@ -979,16 +983,18 @@ PATTERN;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Appends a LEFT OUTER JOIN part to the query.
|
* Appends a LEFT OUTER JOIN part to the query.
|
||||||
* @param string|array $table the table to be joined.
|
* @param string|array $table the table or sub-query to be joined.
|
||||||
*
|
*
|
||||||
* Use a string to represent the name of the table to be joined.
|
* Use a string to represent the name of the table to be joined.
|
||||||
* The table name can contain a schema prefix (e.g. 'public.user') and/or table alias (e.g. 'user u').
|
* The table name can contain a schema prefix (e.g. 'public.user') and/or table alias (e.g. 'user u').
|
||||||
* The method will automatically quote the table name unless it contains some parenthesis
|
* The method will automatically quote the table name unless it contains some parenthesis
|
||||||
* (which means the table is given as a sub-query or DB expression).
|
* (which means the table is given as a sub-query or DB expression).
|
||||||
*
|
*
|
||||||
* Use an array to represent joining with a sub-query. The array must contain only one element.
|
* You may also specify the table as an array with one element, using the array key as the table alias
|
||||||
* The value must be a [[Query]] object representing the sub-query while the corresponding key
|
* (e.g. ['u' => 'user']).
|
||||||
* represents the alias for the sub-query.
|
*
|
||||||
|
* To join a sub-query, use an array with one element, with the value set to a [[Query]] object
|
||||||
|
* representing the sub-query, and the corresponding key representing the alias.
|
||||||
*
|
*
|
||||||
* @param string|array $on the join condition that should appear in the ON part.
|
* @param string|array $on the join condition that should appear in the ON part.
|
||||||
* Please refer to [[join()]] on how to specify this parameter.
|
* Please refer to [[join()]] on how to specify this parameter.
|
||||||
@ -1003,16 +1009,18 @@ PATTERN;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Appends a RIGHT OUTER JOIN part to the query.
|
* Appends a RIGHT OUTER JOIN part to the query.
|
||||||
* @param string|array $table the table to be joined.
|
* @param string|array $table the table or sub-query to be joined.
|
||||||
*
|
*
|
||||||
* Use a string to represent the name of the table to be joined.
|
* Use a string to represent the name of the table to be joined.
|
||||||
* The table name can contain a schema prefix (e.g. 'public.user') and/or table alias (e.g. 'user u').
|
* The table name can contain a schema prefix (e.g. 'public.user') and/or table alias (e.g. 'user u').
|
||||||
* The method will automatically quote the table name unless it contains some parenthesis
|
* The method will automatically quote the table name unless it contains some parenthesis
|
||||||
* (which means the table is given as a sub-query or DB expression).
|
* (which means the table is given as a sub-query or DB expression).
|
||||||
*
|
*
|
||||||
* Use an array to represent joining with a sub-query. The array must contain only one element.
|
* You may also specify the table as an array with one element, using the array key as the table alias
|
||||||
* The value must be a [[Query]] object representing the sub-query while the corresponding key
|
* (e.g. ['u' => 'user']).
|
||||||
* represents the alias for the sub-query.
|
*
|
||||||
|
* To join a sub-query, use an array with one element, with the value set to a [[Query]] object
|
||||||
|
* representing the sub-query, and the corresponding key representing the alias.
|
||||||
*
|
*
|
||||||
* @param string|array $on the join condition that should appear in the ON part.
|
* @param string|array $on the join condition that should appear in the ON part.
|
||||||
* Please refer to [[join()]] on how to specify this parameter.
|
* Please refer to [[join()]] on how to specify this parameter.
|
||||||
|
|||||||
Reference in New Issue
Block a user