Nelson Teixeira
Nelson Teixeira

Reputation: 6562

Doctrine entity relations on Symfony 2

I found the entity creation/modification on Symfony's documentation a bit confusing. I have my database tables created and the entity classes written. They are working fine and getting and saving objects normaly to the database. If I want to change something in the model, say, the persist option of an association, do I have to do anything besides put the annotation in the entity class ? I mean like running a console command ? other example: If I add a column in the database and then write the respective fields and annotations manually in the entity class, will it be enough ? or I would still have to run some console command ?

Upvotes: 0

Views: 56

Answers (1)

acj89
acj89

Reputation: 258

It will be enough.

But the usual practice is to add properties and annotations in Entity class first and then update the schema using the command

php app/console doctrine:schema:update --force

Upvotes: 2

Related Questions