From 06598c13417fb6248ed6892922379437cc7a9fdd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Wed, 20 Jan 2010 23:52:56 +0100 Subject: [PATCH] Adapt UserFilter and notifs to the new PFC classes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- classes/userfilter.php | 6 +++--- include/notifs.inc.php | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) 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))); } -- 2.1.4