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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -