On Tue, Mar 27, 2012 at 11:35:53PM -0700, Richard Shank wrote:
> >
> >But this is a digression.
> In a situation where you are writing a bundle that can be used
> across a number of persistence types, its not really practical to
> have the model inherit from the persistence.
Not sure I agree.
> $myAwesome = $this->container->get('my_awesome.manager')->createMyAwesome();
This one I like. I use something similar bur using the manager to get new
objects aswell is a good idea since we can inject the persistance layer
at the same time.
> Look at https://github.com/FriendsOfSymfony/FOSUserBundle for a
> great example of this. However, if you are not writing for a bundle,
> I'm not sure how much it matters if you split the persistence part
> of the code from the rest of the logic.
I use FOSUserBundle and I do this in my project:
use FOS\UserBundle\Entity\User as BaseUser;
class User extends BaseUser
Which is the way I talk about.
On the other hand, there can be magic somewhere that in fact makes this
extend work in different manners.
I haven't tried to use the UserBundle with my own Mongo-"orm" and see how
easy it is to handle but if I understand how the bundle works it should not
be that hard.
Thomas.
--
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 developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en