Specify entity name while generating from existing database table symfony2

115 views Asked by At

I've a database table users and I want to generate its entity in my symfony2 bundle KapCrudBundle.

I'm using the following commands:

php app/console doctrine:mapping:convert yml ./src/Kap/CrudBundle/Resources/config/doctrine/metadata/orm --from-database --force --filter=Users

php app/console doctrine:mapping:import KapCrudBundle annotation --filter=Users

php app/console doctrine:generate:entities KapCrudBundle

These all above commands working absolutely fine but I want to do the following things:

  1. It's generating the entity Users.php and annotation file Users.orm.yml because my table name is users but I want the entity name and annotation files like User.php and User.orm.yml

  2. Second thing is that it generates all entities again in the bundle but I want only the User entity to generate.

1

There are 1 answers

0
BlueM On

Regarding the 2nd question: you can simply specify the entity.

php app/console doctrine:generate:entities KapCrudBundle/Entity/User