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)
}
}
-class ProfileDataIterator
+
+/** Iterator over a set of Profiles
+ */
+class ProfileIterator implements PlIterator
{
private $iterator = null;
private $fields;
}
}
-/** 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:
?>