Search code examples
symfonydoctrine-ormormreverse-engineering

How to specify a destination directory in Generate Entities with Doctrine2


Im using symfony framework with Doctrine as ORM. When i run this command:

php bin/console doctrine:mapping:convert annotation ./src --env=local --em=myentitymanager

I get this output: Processing entity "AppBundle\Entity\Offer" Processing entity "AppBundle\Entity\Product"

I need to know if exist some argument or some way to create the entities in a subdirectory inside AppBundle/Entity. So is any way to get this output?

Processing entity "AppBundle\Entity\Exampledir\Peticion" Processing entity "AppBundle\Entity\Exampledir\Tecnologia"


Solution

  • Unfortunately the php bin/console doctrine:mapping:convert command does not accept a parameter to define the entity directory.

    The target folder of the bundle has been hardcoded in the source code as:

    • if you choose annotation it's /Entity
    • if you choose xml, it's /Resources/config/doctrine