Re: [symfony-users] symfony2 - access everything from Entity class

2011-02-17 Thread Christophe COEVOET

Le 16/02/2011 23:00, Lideln a écrit :

Hi !

I am experimenting the PR6, but I could not find how to access things
from Entity just as you would do from Controller ($this-

get('database_connection') or $this-
get('doctrine.orm.entity_manager') and so on).

It would be nice to place all "static" database queries inside the
Entities.
The right place for the queries is the EntityRepository, not the entity 
itself. Look at the Doctrine2 doc about custom repositories: 
http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html#custom-repositories

And also, I am willing to use my Member Entity as the Domain Object
for the register page.
Same here. Use your custom repository by implementing 
Symfony\Component\Security\Core\User\UserProviderInterface and use the 
Doctrine entity Provider as described here: 
http://docs.symfony-reloaded.org/master/guides/security/users.html#doctrine-entity-provider


Regards

--
Christophe | Stof

--
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


[symfony-users] symfony2 - access everything from Entity class

2011-02-17 Thread Lideln
Hi !

I am experimenting the PR6, but I could not find how to access things
from Entity just as you would do from Controller ($this-
>get('database_connection') or $this-
>get('doctrine.orm.entity_manager') and so on).

It would be nice to place all "static" database queries inside the
Entities.

And also, I am willing to use my Member Entity as the Domain Object
for the register page.

Thank you all !

-- 
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