Adapt UserFilter and notifs to the new PFC classes
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Wed, 20 Jan 2010 22:52:56 +0000 (23:52 +0100)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Sat, 13 Feb 2010 23:30:48 +0000 (00:30 +0100)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
classes/userfilter.php
include/notifs.inc.php

index 9dca690..d9d71c4 100644 (file)
@@ -1160,17 +1160,17 @@ class UserFilter
 
     public function __construct($cond = null, $sort = null)
     {
-        if (empty(self::$joinMethods)) {
+        if (empty($this->joinMethods)) {
             $class = new ReflectionClass('UserFilter');
             foreach ($class->getMethods() as $method) {
                 $name = $method->getName();
                 if (substr($name, -5) == 'Joins' && $name != 'buildJoins') {
-                    self::$joinMethods[] = $name;
+                    $this->joinMethods[] = $name;
                 }
             }
         }
         if (!is_null($cond)) {
-            if ($cond instanceof UserFilterCondition) {
+            if ($cond instanceof PlFilterCondition) {
                 $this->setCondition($cond);
             }
         }
index 6601c1e..dae7b78 100644 (file)
@@ -36,7 +36,7 @@ abstract class WatchOperation
     {
         $this->date = $date;
         if (!$user->watch($this->flag)) {
-            return new UFC_False();
+            return new PFC_False();
         } else {
             return $this->buildCondition($user);
         }
@@ -133,8 +133,8 @@ class WatchRegistration extends WatchOperation
 
     protected function buildCondition(PlUser &$user)
     {
-        return new UFC_And(new UFC_Registered(false, '>', $this->date),
-                           new UFC_Or(new UFC_WatchContact($user),
+        return new PFC_And(new UFC_Registered(false, '>', $this->date),
+                           new PFC_Or(new UFC_WatchContact($user),
                                       new UFC_WatchPromo($user)));
     }
 
@@ -156,8 +156,8 @@ class WatchDeath extends WatchOperation
 
     protected function buildCondition(PlUser &$user)
     {
-        return new UFC_And(new UFC_Dead('>', $this->date, true),
-                           new UFC_Or(new UFC_WatchPromo($user),
+        return new PFC_And(new UFC_Dead('>', $this->date, true),
+                           new PFC_Or(new UFC_WatchPromo($user),
                                       new UFC_WatchContact($user)));
     }
 
@@ -191,10 +191,10 @@ class WatchBirthday extends WatchOperation
 
     protected function buildCondition(PlUser &$user)
     {
-        return new UFC_And(new UFC_OR(new UFC_Birthday('=', time()),
-                                      new UFC_And(new UFC_Birthday('<=', time() + self::WATCH_LIMIT),
+        return new PFC_And(new PFC_OR(new UFC_Birthday('=', time()),
+                                      new PFC_And(new UFC_Birthday('<=', time() + self::WATCH_LIMIT),
                                                   new UFC_Birthday('>', $this->date + self::WATCH_LIMIT))),
-                           new UFC_Or(new UFC_WatchPromo($user),
+                           new PFC_Or(new UFC_WatchPromo($user),
                                       new UFC_WatchContact($user)));
     }