From: Raphaël Barrois Date: Wed, 20 Jan 2010 22:52:56 +0000 (+0100) Subject: Adapt UserFilter and notifs to the new PFC classes X-Git-Tag: xorg/1.0.0~332^2~283 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=06598c13417fb6248ed6892922379437cc7a9fdd;p=platal.git Adapt UserFilter and notifs to the new PFC classes Signed-off-by: Raphaël Barrois --- diff --git a/classes/userfilter.php b/classes/userfilter.php index 9dca690..d9d71c4 100644 --- a/classes/userfilter.php +++ b/classes/userfilter.php @@ -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); } } diff --git a/include/notifs.inc.php b/include/notifs.inc.php index 6601c1e..dae7b78 100644 --- a/include/notifs.inc.php +++ b/include/notifs.inc.php @@ -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))); }