php - Sort symfony users by roles -


i have user entity. implements basic user-interface.
want sort users roles , don't know how it.

(it send message admins message entity targeting user entity on manytoone relation)

$query = $this->getdoctrine()->getentitymanager()             ->createquery(                 'select u mybundle:user u u.roles :role'             )->setparameter('role', '%"role_my_admin"%');  $users = $query->getresult(); 

offload work db server. query shouldn't take long return, 100,000+ records.


Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -