+class Watch
+{
+ private static $classes = array('WatchRegistration',
+ 'WatchProfileUpdate',
+ 'WatchDeath',
+ 'WatchBirthday');
+
+ private static function fetchCount(PlUser &$user, $class)
+ {
+ $obj = new $class();
+ $uf = new UserFilter($obj->getCondition($user));
+ return $uf->getTotalCount();
+ }
+
+ public static function getCount(PlUser &$user)
+ {
+ $count = 0;
+ foreach (self::$classes as $class) {
+ $count += self::fetchCount($user, $class);
+ }
+ return $count;
+ }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: