X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fgroup.php;h=f58ff6b1a3e96489a2f10b838ae92eb32929a40a;hb=23ba40c466e05d369cd9e2a96107f38e309b767a;hp=a13b0779b10b924ccd60eba12ad45712c7a8c28c;hpb=684195f33b11e3067200dd3a9e14304bd7d04463;p=platal.git diff --git a/classes/group.php b/classes/group.php index a13b077..f58ff6b 100644 --- a/classes/group.php +++ b/classes/group.php @@ -56,21 +56,33 @@ class Group { $cond = new UFC_Group($this->id, $admin); if (!is_null($extra_cond)) { - $cond = new UFC_And($cond, $extra_cond); + $cond = new PFC_And($cond, $extra_cond); } return new UserFilter($cond, $sort); } - public function getMembers($extra_cond = null, $sort = null) + public function getMembersFilter($extra_cond = null, $sort = null) { return $this->getUF(false, $extra_cond, $sort); } - public function getAdmins($extra_cond = null, $sort = null) + public function getAdminsFilter($extra_cond = null, $sort = null) { return $this->getUF(true, $extra_cond, $sort); } + public function iterMembers($extra_cond = null, $sort = null, $limit = null) + { + $uf = $this->getMembersFilter($extra_cond, $sort); + return $uf->iterUsers($limit); + } + + public function iterAdmins($extra_cond = null, $sort = null, $limit = null) + { + $uf = $this->getAdminsFilter($extra_cond, $sort); + return $uf->iterUsers($limit); + } + public function getLogo($fallback = true) { if (!empty($this->logo)) { @@ -86,7 +98,7 @@ class Group if (!$id) { return null; } - if (ctype_digit($id)) { + if (is_int($id) || ctype_digit($id)) { $where = XDB::format('id = {?}', $id); } else { $where = XDB::format('diminutif = {?}', $id);