1

I have configured doctrine ORM in my ZF2 project and create doctrine entity of whole database. Now, I have added one more table named dashboard_group in database. How can I create Doctrine entity for only this table.

I don't want to replace other created entities.

2
  • Are you generating your entities with the doctrine command line tool ? Commented Apr 9, 2015 at 13:10
  • yes, but unable to generate single table entity. Please suggest Commented Apr 13, 2015 at 8:52

1 Answer 1

2

Use –filter option in your command :

./vendor//bin/doctrine-module orm:convert-mapping --namespace="YourModule\\Entity\\" --force  --from-database --filter="dashboard_group" annotation ./module/MonModule/src/

And then to add setter/getter into the generated entity :

./vendor/bin/doctrine-module orm:generate-entities ./module/YourModule/src/ --generate-annotations=true --filter="dashboard_group"
Sign up to request clarification or add additional context in comments.

4 Comments

I have tried this one ... but following error are coming "No Metadata Classes to process." Please suggest whats going wrong with me.
How to run the same in windows
I got the same issue: "No Metadata Classes to process", With both commands shows the the same error @blackbishop
@blackbishop I changed in my case: --filter="edificio" from this: --filter="Edificio" just had to uppercase the entity and now it works ok

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.