XF 2.2 Retrieving number of users watching a thread

Orit

Active member
Hi
I'm looking for a way to display the number of users watching each thread.
I tried this: $thread.Watch.count() and it seems to be what I'm looking for.
Can anyone confirm this?

Thanks!!
 
That'll work, but it'll also load all the corresponding entities. It may be better to do this, which will only query the count:

HTML:
$thread.getRelationFinder('Watch').total()
 
Back
Top Bottom