|
|
|
@ -479,7 +479,18 @@ class Query extends Component implements QueryInterface
|
|
|
|
|
throw new InvalidConfigException(gettype($this->from) . ' in $from is not supported.'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Clean up table names and aliases |
|
|
|
|
return $this->cleanUpTableNames($tableNames); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Clean up table names and aliases |
|
|
|
|
* Both aliases and names are enclosed into {{ and }}. |
|
|
|
|
* @param array $tableNames non-empty array |
|
|
|
|
* @return string[] table names indexed by aliases |
|
|
|
|
* @since 2.0.14 |
|
|
|
|
*/ |
|
|
|
|
protected function cleanUpTableNames($tableNames) |
|
|
|
|
{ |
|
|
|
|
$cleanedUpTableNames = []; |
|
|
|
|
foreach ($tableNames as $alias => $tableName) { |
|
|
|
|
if (is_string($tableName) && !is_string($alias)) { |
|
|
|
|