Tables can be passed as an array of strings, array of expression
objects, a single expression or a single string.
If an array is passed, keys will be used to alias tables using the value as the
real field to be aliased. It is possible to alias strings, ExpressionInterface objects or
even other Query objects.
By default this function will append any passed argument to the list of tables
to be selected from, unless the second argument is set to true.
This method can be used for select, update and delete statements.
### Examples:
$query->from(['p' => 'posts']); // Produces FROM posts p
$query->from('authors'); // Appends authors: FROM posts p, authors
$query->from(['products'], true); // Resets the list: FROM products
$query->from(['sub' => $countQuery]); // FROM (SELECT ...) sub
public from ( array | string $tables = [], boolean $overwrite = false ) | ||
$tables | array | string | tables to be added to the list. This argument, can be passed as an array of strings, array of expression objects, or a single string. See the examples above for the valid call types. |
$overwrite | boolean | whether to reset tables with passed list or not |