1

How to configure ZF3 project to be able to use generate-entities command from Doctrine Orm Tools ?

I use Application\Entity namespace for the models, this tool generates entities in Application\Entity directory, not in Application\src\Entity dir.

How to tweak this?

Arachmes
  • 13
  • 3
  • Possible duplicate of [How to generate Doctrine entities From Database and Use PSR-4 Autoloading?](https://stackoverflow.com/questions/44504058/how-to-generate-doctrine-entities-from-database-and-use-psr-4-autoloading) – halfpastfour.am Aug 31 '18 at 11:34

2 Answers2

1

You actually can't tweak this, the doctrine generator is only psr-0 and will not be updated (and will probably be removed in future versions). I do not have sources here, just stuff I reckon reading on the github project.

What you could do though is create a psr-0 loaded module, and change your config to use psr-0 just for your entities, but I would greatly recommend against it. If you want to go down that way, just update your composer autoload section to add your psr-0.

Thomas Dutrion
  • 1,844
  • 1
  • 11
  • 9
-1

Your question is already answered here on stackoverflow. You have 2 options:

Option 1:

How to generate Doctrine entities From Database and Use PSR-4 Autoloading?

Option 2:

Just create the entities manually yourself. ( that’s what I do )

Good luck !

Mecanik
  • 1,539
  • 1
  • 20
  • 50