From be7c0693604eedee19bee97d1925cfacfc5e5adb Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Mon, 13 Aug 2007 18:34:57 +0000 Subject: [PATCH] MDL-10829 Added get_idnumber() for both category and item classes --- lib/grade/grade_category.php | 10 ++++++++++ lib/grade/grade_item.php | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/lib/grade/grade_category.php b/lib/grade/grade_category.php index 5ab5293d03d..70cc6fc9f60 100644 --- a/lib/grade/grade_category.php +++ b/lib/grade/grade_category.php @@ -939,6 +939,16 @@ class grade_category extends grade_object { return $this->grade_item->get_sortorder(); } + /** + * Returns the idnumber of the associated grade_item. This method is also available in + * grade_item, for cases where the object type is not known. + * @return string idnumber + */ + function get_idnumber() { + $this->load_grade_item(); + return $this->grade_item->get_idnumber(); + } + /** * Sets sortorder variable for this category. * This method is also available in grade_item, for cases where the object type is not know. diff --git a/lib/grade/grade_item.php b/lib/grade/grade_item.php index 31dade871e2..5d7b58c5057 100644 --- a/lib/grade/grade_item.php +++ b/lib/grade/grade_item.php @@ -1018,6 +1018,15 @@ class grade_item extends grade_object { return $this->sortorder; } + /** + * Returns the idnumber of this grade_item. This method is also available in + * grade_category, for cases where the object type is not know. + * @return string idnumber + */ + function get_idnumber() { + return $this->idnumber; + } + /** * Sets the sortorder of this grade_item. This method is also available in * grade_category, for cases where the object type is not know.