2

I want to make use of a Symfony 4 Console option for MongoDB.

The console option I want to use is:

php bin/console doctrine:mongodb:generate:documents

I get the next error message:

Error thrown while running command "doctrine:mongodb:generate:documents". Message: "Not enough arguments (missing: "bundle").

But since Symfony 4 doesn't have bundles anymore what must I do to let Symfony 4 generates the documents for me? I couldn't find any documentation about this for Symfony 4.

Antoine Galluet
  • 320
  • 4
  • 14
D3F
  • 156
  • 1
  • 9
  • Seems you should provide the bundleName as described here http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html#generating-getters-and-setters – Matteo Mar 07 '18 at 13:14
  • What if it's a bundle less sf4 application? – Omar Alves May 07 '18 at 14:51

2 Answers2

0

As you wrote, there aren't any bundles in Symfony4, therefore this command is useless.

You can run kernel method getBundles() to see the list of bundles in your application, but you'll see that the only bundles you find are the ones you're using as external packages, that haven't upgraded to Symfony4 yet.

0

It exists a command to generate MongoDB document PHP classes for a Symfony 4 project. Type following commands in a terminal to generate a document class:

cd your-symfony-4-project-folder
composer require samuel-tallet/symfony-mongodb-document-maker
cd vendor/samuel-tallet/symfony-mongodb-document-maker
php bin/console generate:document