From: Raphaël Barrois Date: Tue, 16 Mar 2010 19:26:53 +0000 (+0100) Subject: Rename ProfileDataIterator to ProfileIterator X-Git-Tag: xorg/1.0.0~332^2~50 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=31ef12ef98ae5cfd45060bf90c5147a2b01b2b4f;p=platal.git Rename ProfileDataIterator to ProfileIterator Signed-off-by: Raphaël Barrois --- diff --git a/classes/profile.php b/classes/profile.php index 4cfc845..b016b6d 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -512,7 +512,7 @@ class Profile WHERE p.pid IN ' . XDB::formatArray($pids) . ' GROUP BY p.pid ' . $order); - return new ProfileDataIterator($it, $pids, $fields, $visibility); + return new ProfileIterator($it, $pids, $fields, $visibility); } public static function getPID($login) @@ -709,7 +709,10 @@ class Profile } } -class ProfileDataIterator + +/** Iterator over a set of Profiles + */ +class ProfileIterator implements PlIterator { private $iterator = null; private $fields; @@ -855,45 +858,5 @@ class ProfileDataIterator } } -/** Iterator over a set of Profiles - * @param an XDB::Iterator obtained from a Profile::fetchProfileData - */ -class ProfileIterator implements PlIterator -{ - private $pdi; - private $dbiter; - - public function __construct(ProfileDataIterator &$pdi) - { - $this->pdi = $pdi; - $this->dbiter = $pdi->iterator(); - } - - public function next() - { - $data = $this->dbiter->next(); - if ($data == null) { - return null; - } else { - return $this->pdi->fillProfile(Profile::get($data)); - } - } - - public function total() - { - return $this->dbiter->total(); - } - - public function first() - { - return $this->dbiter->first(); - } - - public function last() - { - return $this->dbiter->last(); - } -} - // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>