Port remaining queries from module events.
[platal.git] / modules / carnet / feed.inc.php
index 68f7fcf..3172b4a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -29,7 +29,7 @@ class CarnetFeedIterator implements PlIterator
     public function __construct(Notifs& $notifs)
     {
         $this->notifs =& $notifs;
-        $this->it = new PlArrayIterator($notifs->_data, 3);
+        $this->it = PlIteratorUtils::fromArray($notifs->_data, 3);
     }
 
     public function next()
@@ -84,9 +84,9 @@ class CarnetFeed extends PlFeed
                             'carnet/rss.tpl');
     }
 
-    protected function fetch($user)
+    protected function fetch(PlUser &$user)
     {
-        return new CarnetFeedIterator(new Notifs($user, false));
+        return new CarnetFeedIterator(new Notifs($user->id(), false));
     }
 }