+
+
+ private static function getDate(PlUser &$user, $date)
+ {
+ if (is_null($date)) {
+ $date = $user->watchLast();
+ $limit = time() - (7 * 86400);
+ if ($date < $limit) {
+ $date = $limit;
+ }
+ }
+ return $date;
+ }
+
+ public static function getCount(PlUser &$user, $date = null)
+ {
+ $watch = new Watch($user, $date);
+ return $watch->count();
+ }
+
+ public static function getEvents(PlUser &$user, $date = null)
+ {
+ $watch = new Watch($user, $date);
+ return $watch->events();
+ }