]> git.mjollnir.org Git - moodle.git/commit
datalib:course_parent_visible() rework, remove category_parent_visible()
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:19:05 +0000 (07:19 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:19:05 +0000 (07:19 +0000)
commit3511647c443294e0c5b54d813e563d64c4ff29b0
treedf8ea2914679c5168560bb4a6cf0e79902368193
parent82c62d1b17a01303cae55c9ecd9ac252af95573f
datalib:course_parent_visible() rework, remove category_parent_visible()

Reworked course_parent_visible() to always return in a constant
number of db queries (2 worst case) regardless of nesting depth.

The rewritten version has a small cache, but if you are going to
walk many courses, it's still 1~2 DB queries per category seen,
so the right thing to do is to check it in the caller, as seen
in get_my_courses().
lib/datalib.php