Skip to main content
1 of 2
Mołot
  • 21.9k
  • 8
  • 59
  • 112

I'm afraid it will be hard.

Seems like you are looking for something like this feature - sadly, it is not implemented (yet?). Problem is, SQL does not support anti-joins in any reliable generic way, so most of generic solutions built on top of SQL databases can't do it, either. Materials I used to code similar case (or similar ones) are still to be found under this search: google.pl/search?q=sql+anti-joi

Maybe there is a way to create view like that. If you only want it to work when view is filtered by one user, you could implement hook_query_alter(). Use ->hasTag() to determine if query came from the view you want to alter, and then ->conditions() to make sure it shows results for just one user (to avoid things getting messy). Then you can outer join appropriate table and (if it's our usual many-to-many intermediate table), only select rows where registration entry ->isNull().

Mołot
  • 21.9k
  • 8
  • 59
  • 112