mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Allow for proper database resolve with schemas (#1349)
* Allow for proper database resolve with schemas * Remove need to explode database and table name
This commit is contained in:
@@ -463,6 +463,7 @@ class ModelsCommand extends Command
|
|||||||
*/
|
*/
|
||||||
public function getPropertiesFromTable($model)
|
public function getPropertiesFromTable($model)
|
||||||
{
|
{
|
||||||
|
$database = $model->getConnection()->getName();
|
||||||
$table = $model->getConnection()->getTablePrefix() . $model->getTable();
|
$table = $model->getConnection()->getTablePrefix() . $model->getTable();
|
||||||
$schema = $model->getConnection()->getDoctrineSchemaManager();
|
$schema = $model->getConnection()->getDoctrineSchemaManager();
|
||||||
$databasePlatform = $schema->getDatabasePlatform();
|
$databasePlatform = $schema->getDatabasePlatform();
|
||||||
@@ -482,11 +483,6 @@ class ModelsCommand extends Command
|
|||||||
$databasePlatform->registerDoctrineTypeMapping($yourTypeName, $doctrineTypeName);
|
$databasePlatform->registerDoctrineTypeMapping($yourTypeName, $doctrineTypeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
$database = null;
|
|
||||||
if (strpos($table, '.')) {
|
|
||||||
[$database, $table] = explode('.', $table);
|
|
||||||
}
|
|
||||||
|
|
||||||
$columns = $schema->listTableColumns($table, $database);
|
$columns = $schema->listTableColumns($table, $database);
|
||||||
|
|
||||||
if (!$columns) {
|
if (!$columns) {
|
||||||
|
|||||||
Reference in New Issue
Block a user