| @@ 165-174 (lines=10) @@ | ||
| 162 | * @return string |
|
| 163 | * @throws SchemaException |
|
| 164 | */ |
|
| 165 | public function databaseAlias(AbstractTable $table) |
|
| 166 | { |
|
| 167 | foreach ($this->aliases as $item) { |
|
| 168 | if ($item['schema'] === $table) { |
|
| 169 | return $item['database']; |
|
| 170 | } |
|
| 171 | } |
|
| 172 | ||
| 173 | throw new SchemaException("Unable to resolve database alias for table '{$table->getName()}'"); |
|
| 174 | } |
|
| 175 | ||
| 176 | /** |
|
| 177 | * Table aliases associated with given table schema. |
|
| @@ 183-192 (lines=10) @@ | ||
| 180 | * @return string |
|
| 181 | * @throws SchemaException |
|
| 182 | */ |
|
| 183 | public function tableAlias(AbstractTable $table) |
|
| 184 | { |
|
| 185 | foreach ($this->aliases as $item) { |
|
| 186 | if ($item['schema'] === $table) { |
|
| 187 | return $item['table']; |
|
| 188 | } |
|
| 189 | } |
|
| 190 | ||
| 191 | throw new SchemaException("Unable to resolve table alias for table '{$table->getName()}'"); |
|
| 192 | } |
|
| 193 | ||
| 194 | /** |
|
| 195 | * Perform schema reflection to database(s). All declared tables will created or altered. Only |
|