I’m using symfony 7.1 and I want to generate entities from my existing tables but it seems it doesn’t work. First I run this command php bin/console doctrine:mapping:import “AppEntity” annotation –path=src/Entity I’ve got message tell me import command was not found. WhenI tried to use php bin/console make:entity –regenerate it was like creating new entity.
Any suggestions how to generate all entities using one command ?
Thanks.
1
The doctrine:mapping:import command used to generate Doctrine entities
from existing databases was deprecated by Doctrine in 2019 and there’s
no replacement for it.Instead, you can use the make:entity command from Symfony Maker Bundle
to help you generate the code of your Doctrine entities. This command
requires manual supervision because it doesn’t generate entities from
existing databases.
Source: https://symfony.com/doc/current/doctrine/reverse_engineering.html
There isn’t currently a command to generate all entities using one command.
As for make:entity, try:
php bin/console cache:clear
php bin/console make:entity --regenerate App
2