Answer the question
In order to leave comments, you need to log in
How to set additional properties to entities in Doctrine ORM?
Hello! Before I used any ORM, I crutched my models, and if after receiving, for example, publication, from the model, in the controller, if I need to set additional properties for it (necessary only in the controller and view, for example, a link), then and wrote: $post->link = /blog/.$post->id
Now I use Doctrine ORM, in which properties should be private, and setters / getters for such things (which are not entered into the database, only the controller and view) don't have to do.
Gentlemen and ladies, what is the best way to manage in these cases, if you need to add any properties like link and something else that I might need to each object for use in the controller and view?
ps I use Doctrine alone without Symfony in my bike.
Answer the question
In order to leave comments, you need to log in
Now I use Doctrine ORM, whose properties should be private, and setters / getters for such things ( which are not entered into the database , only the controller and the view) do not need to be done.
/blog/
and this can change quite often ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question