jacquestvanzuydam / laravel-firebird

Firebird Illuminate package for Laravel 5
63 stars 93 forks source link

Laravel 5.4 and Laravel 5 IDE Helper Generator problem #46

Closed m-ochyra closed 11 months ago

m-ochyra commented 7 years ago

I have problem with generating helper with Laravel 5 IDE Helper Generator. I created second connection to Firebird database and model:

<?php

namespace App\Models\Firebird;

use Illuminate\Database\Eloquent\Model;

class ScEvents extends Model
{
    protected $connection = 'firebird';
    protected $table = 'SC_EVENTS';
}

Next when I run command php artisan ide-helper:models have this error:

  [Symfony\Component\Debug\Exception\FatalThrowableError]
  Call to undefined method Firebird\Connection::getDoctrineDriver()

Connection with Firebird database and model is OK.

Full log message:

[2017-03-14 10:16:40] local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined method Firebird\Connection::getDoctrineDriver() in ***\vendor\laravel\framework\src\Illuminate\Database\Connection.php:853
Stack trace:
#0 ***\vendor\barryvdh\laravel-ide-helper\src\Console\ModelsCommand.php(311): Illuminate\Database\Connection->getDoctrineSchemaManager('SC_ACTIONS')
#1 ***\vendor\barryvdh\laravel-ide-helper\src\Console\ModelsCommand.php(195): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->getPropertiesFromTable(Object(App\Models\Firebird\ScActions))
#2 ***\vendor\barryvdh\laravel-ide-helper\src\Console\ModelsCommand.php(95): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->generateDocs(Array, Array)
#3 [internal function]: Barryvdh\LaravelIdeHelper\Console\ModelsCommand->fire()
#4 ***\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(29): call_user_func_array(Array, Array)
#5 ***\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#6 ***\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#7 ***\vendor\laravel\framework\src\Illuminate\Container\Container.php(524): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#8 ***\vendor\laravel\framework\src\Illuminate\Console\Command.php(182): Illuminate\Container\Container->call(Array)
#9 ***\vendor\symfony\console\Command\Command.php(265): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#10 ***\vendor\laravel\framework\src\Illuminate\Console\Command.php(167): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#11 ***\vendor\symfony\console\Application.php(826): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 ***\vendor\symfony\console\Application.php(189): Symfony\Component\Console\Application->doRunCommand(Object(Barryvdh\LaravelIdeHelper\Console\ModelsCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 ***\vendor\symfony\console\Application.php(120): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 ***\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(123): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 ***\artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 {main}  
KKSzymanowski commented 7 years ago

I know this is an old question, but I had this myself, and this exception is thrown because Doctrine\DBAL doesn't support Firebird DBMS. As you can see here, it supports MySQL, Sqlite, Postgres, many others but not Firebird(which is not that suprising given it has little popularity).

If you plan to use it often, you can take a look at how these drivers(eg. for Oracle) are built and create one for Firebird but I'm afraid it might not be an easy task.

KKSzymanowski commented 7 years ago

@jacquestvanzuydam One thing you can do for now is add the Firebird\Connection::getDoctrineDriver() method looking something like this:

protected function getDoctrineDriver()
{
    throw new \Exception("Firebird is not supported by Doctrine");
}

to give a clearer feedback.