I've been playing around with sf2 lately and been looking at code from the various github projects but I'm still not really sure what (and more importantly *why*) is going on with the Model classes.
I've picked up on the concept that Entities should remain fairly untouched from complex (business) logic, but I can't really figure out where I should leave the logic then? I think the FriendsOfSymfony/UserBundle is a good example to look at, but it looks really weird from my point of view what they do with the models and entities. At least how I understand is that they make the Entity extend the Model so that the complex (business) logic is placed in the Model class instead of the Entity but they can still access that logic when they've fetched Entities through doctrine ORM. They seem to do the same for the EntityManager classes. The real questions I have (to make it a bit easier to answer) are; 1) What stuff *should* be placed in the normal Entity? (or maybe it's easier to give a clearer definition of what shouldn't?) 2) Is the Entity extending a Model class the 'way to go'? Asuming it is; 3) What stuff should be placed in the Model and what should go in the EntityManager? 4) Why does the EntityManager extend a corresponding manager from the Model namespace too? I hope somebody can shine a light on this, this is what curently makes it hard to get started with sf2 (if you ask me); finding the right/ correct way to do things. Something that the sf1.4 jobeet tutorial (and more sf1.4 books / blogs / tutorials) really helped a lot with,since it contained a lot of reasoning why things are done the way it is done. For me that is a big reason to use symfony; it encourages using best practices and becoming a better programmer (where most other frameworks only tell you what to do to get the job done like a brainless script kiddie) -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en