In the frontend I have a page with a list and a form filter next to it that shows all the users of a social network.
I would like to hide the user of the session in that list. How can I do it?
My first thought is creating a function, addXXXXColumnQuery()
, for each
field of the form, and in each one add a line like this:
->andWhere("u.id <> ?", $id)
$id being the ID of the user of the current session. But in that way I find I'm repeating myself.
What should I do?