X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations.inc.php;h=35746bd010b09e8ec33d9af0b393886fafdce7b6;hb=2ec34fdb742c2ec60ae264e068a00c888a73c447;hp=eb2cd4c3ee47b068cc86171b065910e4c9db6f4f;hpb=9756357a151d461e49699938c8baee6ec81f1611;p=platal.git diff --git a/include/validations.inc.php b/include/validations.inc.php index eb2cd4c..35746bd 100644 --- a/include/validations.inc.php +++ b/include/validations.inc.php @@ -624,6 +624,25 @@ abstract class ProfileValidate extends Validate } // }}} + // {{{ function get_all_typed_requests() + + /** Same as get_typed_request() but return an array of objects. + */ + static public function get_all_typed_requests($type) + { + $res = XDB::iterRow('SELECT data + FROM requests + WHERE type = {?} + ORDER BY stamp', + $type); + $array = array(); + while (list($data) = $res->next()) { + $array[] = Validate::unserialize($data); + } + return $array; + } + + // }}} // {{{ function get_typed_requests_count() /** Same as get_typed_requests() but returns the count of available requests.