Hello,
i`ve been playing with symfony a few weeks now. its great. most of the approaches are really nice. But i have some headache with doctrine entities and the access of the service container. Out of the box the DI-Container cant be accessed by entities. I`ve googled a lot and read some discussions. everyone say, it should not be necassary to access the container out of entities. i dont understand this. I like the idea of feature reach models. for example, within a user-model it would be nice to send an registration email like $user->sendRegistrationEmail() or $user->setRandomPass() or something else... maybe i want to do a native sql query (we are using heavily database...)
I know, that i could implement ContainerAware and inject the container. But that looks a bit unbeautiful. I`ve read a lot of times "rethink your model", but i didnt read why? And whats the best practise for the examples above?
greets
Michael
