Symfony 3.4 CLI: Command doctrine: generate: entity не определен

Я работаю с Symfony 3.4, я много раз использовал doctrine: generate: entity в этом проекте до двух недель, сегодня у меня возникла проблема, и я не знаю, в чем ее причина!

$ php bin/console doctrine:generate:entity AppBundle:Payement 

                                                      
  Command "doctrine:generate:entity" is not defined.  
                                                      
  Did you mean one of these?                          
      doctrine:cache:clear-entity-region              
      doctrine:generate:entities                      

Доктрина команд: generate: entity, form & crud отличается от интерфейса командной строки:

$ bin/console | grep "doctrine"
 doctrine
  doctrine:cache:clear-collection-region  Clear a second-level cache collection region.
  doctrine:cache:clear-entity-region      Clear a second-level cache entity region.
  doctrine:cache:clear-metadata           Clears all metadata cache for an entity manager
  doctrine:cache:clear-query              Clears all query cache for an entity manager
  doctrine:cache:clear-query-region       Clear a second-level cache query region.
  doctrine:cache:clear-result             Clears result cache for an entity manager
  doctrine:cache:contains                 Check if a cache entry exists
  doctrine:cache:delete                   Delete a cache entry
  doctrine:cache:flush                    [doctrine:cache:clear] Flush a given cache
  doctrine:cache:stats                    Get stats on a given cache provider
  doctrine:database:create                Creates the configured database
  doctrine:database:drop                  Drops the configured database
  doctrine:database:import                Import SQL file(s) directly to Database.
  doctrine:ensure-production-settings     Verify that Doctrine is properly configured for a production environment.
  doctrine:generate:entities              [generate:doctrine:entities] Generates entity classes and method stubs from your mapping information
  doctrine:mapping:convert                [orm:convert:mapping] Convert mapping information between supported formats.
  doctrine:mapping:import                 Imports mapping information from an existing database
  doctrine:mapping:info                   
  doctrine:query:dql                      Executes arbitrary DQL directly from the command line.
  doctrine:query:sql                      Executes arbitrary SQL directly from the command line.
  doctrine:schema:create                  Executes (or dumps) the SQL needed to generate the database schema
  doctrine:schema:drop                    Executes (or dumps) the SQL needed to drop the current database schema
  doctrine:schema:update                  Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata.
  doctrine:schema:validate                Validate the mapping files.

person Med Karim Garali    schedule 31.05.2018    source источник
comment
symfony.com/blog/introduction-the-symfony-maker-bundle   -  person Cerad    schedule 31.05.2018


Ответы (1)


Вы должны проверить установку SensioGeneratorBundle. В моем случае в AppKernel я забыл эту строку с комментариями и просто раскомментирую ее:

    if ('dev' === $this->getEnvironment()) {
        //$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
        $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
    }
person Med Karim Garali    schedule 31.05.2018