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

sql - VB.NET Operand type clash: date is incompatible with int error -

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

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -