_Group.php

  1. 5.x classes/_Group.php
  2. 4.x classes/_Group.php

Classes

NameDescription
_Group

File

classes/_Group.php
View source
  1. <?php
  2. class _Group extends stdClass
  3. {
  4. const GROUP_COURSE_INFINITE_REPEATS = 9999;
  5. const GROUP_COURSE_INFINITE_REPEATS_THRESHOLD = 50;
  6. public $title, $icon_filename, $group_id, $requirement_type, $min_grade, $group_name;
  7. public $hours_required, $min_hours_allowed, $hours_remaining, $hours_fulfilled, $hours_fulfilled_for_credit;
  8. public $hours_required_by_type, $req_by_degree_id;
  9. public $assigned_to_semester_num, $bool_placeholder, $data_entry_comment;
  10. public $list_courses, $list_groups, $db, $count_of_matches, $bool_winning_branch;
  11. public $catalog_year;
  12. public $priority;
  13. //////////////////
  14. /// From the database...
  15. public $db_unassign_group_id, $db_delete_flag, $db_catalog_repeat;
  16. ///////////////
  17. /// Used with in-system logic....
  18. public $hours_assigned;
  19. public $bool_use_draft;
  20. /**
  21. * $title "Free Electives","Core Fine Arts", etc.
  22. * $icon_filename monalisa.gif, tower1.gif, etc.
  23. * $group_id ID of the group in the db table.
  24. *
  25. * $type Major, Supporting, Core, etc.
  26. * $min_grade This is if the group itself has a min grade requirement.
  27. * Ex: B,C etc.
  28. * $list_courses This is a CourseList of courses. These are
  29. * the courses which are actually required by the group.
  30. * If individual courses have their own min grade requirements,
  31. * or what have you, that only refer to this group, then they
  32. * would be put in here.
  33. * $list_groups This is a list of groups that belong within this group.
  34. * Used when you have branching. Potentially can be quite
  35. * complicated, since each group in the list can also have
  36. * subgroups.
  37. **/
  38. function __construct($group_id = "", DatabaseHandler $db = NULL, $semester_num = -1, $array_significant_courses = false, $bool_use_draft = false, $requirement_type = "")
  39. {
  40. $this->group_id = $group_id;
  41. $this->assigned_to_semester_num = $semester_num;
  42. $this->count_of_matches = 0;
  43. $this->hours_assigned = 0;
  44. $this->min_hours_allowed = 0;
  45. $this->list_courses = new CourseList();
  46. $this->list_groups = new GroupList();
  47. $this->bool_use_draft = $bool_use_draft;
  48. $this->hours_required_by_type = array();
  49. $this->requirement_type = $requirement_type;
  50. // Always override if the global variable is set.
  51. if (@$GLOBALS["fp_advising"]["bool_use_draft"] == true) {
  52. $this->bool_use_draft = true;
  53. }
  54. $this->db = $db;
  55. if ($db == NULL || !is_object($db) || !is_resource($db->dbc)) {
  56. $this->db = get_global_database_handler();
  57. }
  58. if ($group_id != "")
  59. {
  60. $this->bool_placeholder = false;
  61. $this->load_group(true, $array_significant_courses);
  62. $this->set_requirement_type($this->requirement_type);
  63. }
  64. }
  65. function assign_to_semester($semester_num)
  66. {
  67. $this->assigned_to_semester_num = $semester_num;
  68. $temp_i = $this->list_courses->i;
  69. $this->list_courses->reset_counter();
  70. while($this->list_courses->has_more())
  71. {
  72. $c = $this->list_courses->get_next();
  73. $c->assigned_to_semester_num = $semester_num;
  74. }
  75. $this->list_courses->i = $temp_i;
  76. }
  77. function reset_list_counters()
  78. {
  79. // Resets the counters on all groups and course lists
  80. // in this group.
  81. $this->list_courses->reset_counter();
  82. $this->list_groups->reset_counter();
  83. }
  84. function assign_min_grade($min_grade)
  85. {
  86. // Assign every course in the group to have this particular min grade.
  87. $this->min_grade = $min_grade;
  88. $this->list_courses->assign_min_grade($min_grade);
  89. $this->list_groups->assign_min_grade($min_grade);
  90. }
  91. /**
  92. * Returns an array of course_id's in this group, as well as any sub-group (branches).
  93. * // Key = course_id, val = TRUE.
  94. */
  95. function get_course_id_array($bool_exclude_assigned_courses = FALSE) {
  96. $rtn = array();
  97. $this->list_courses->reset_counter();
  98. while($this->list_courses->has_more()) {
  99. $c = $this->list_courses->get_next();
  100. if (!$bool_exclude_assigned_courses) {
  101. $rtn[$c->course_id] = TRUE;
  102. }
  103. else {
  104. // Look to see if this course has already been assigned or not. If it has, then we
  105. // should skip it. If it has NOT, then it's OK to add.
  106. if ($c->course_list_fulfilled_by->is_empty == TRUE) {
  107. $rtn[$c->course_id] = TRUE;
  108. }
  109. else {
  110. //$c->load_descriptive_data();
  111. //fpm("Not doing $c->subject_id $c->course_num");
  112. }
  113. }
  114. }
  115. // Also get any sub-group's courses...
  116. $this->list_groups->reset_counter();
  117. while($this->list_groups->has_more()) {
  118. $g = $this->list_groups->get_next();
  119. // $rtn = array_merge($rtn, $g->get_course_id_array());
  120. // Fix by Logan Buth: https://bytetask.com/node/2456
  121. $rtn = $rtn + $g->get_course_id_array();
  122. }
  123. return $rtn;
  124. } // get_course_id_array.
  125. function has_min_hours_allowed() {
  126. return ($this->min_hours_allowed > 0 && $this->min_hours_allowed != $this->hours_required);
  127. }
  128. function get_hours_remaining($semester_num = -1)
  129. {
  130. // returns how many hours are left for this group.
  131. return ($this->hours_required - $this->get_fulfilled_hours(true, true, false, $semester_num));
  132. }
  133. /**
  134. * Return TRUE or FALSE if we've fulfilled the min hour allowed value, if it's set.
  135. */
  136. function get_is_min_hours_allowed_fulfilled($semester_num = -1) {
  137. if ($this->min_hours_allowed < 1) return TRUE;
  138. $v = $this->get_fulfilled_hours(true, true, false, $semester_num);
  139. if ($v >= $this->min_hours_allowed) return TRUE;
  140. return FALSE;
  141. }
  142. /**
  143. * We expect the group_id to be our db_group_id + _ + degree_id, to ensure
  144. * that groups are unique to a degree. Let's return just the database group_id portion (the number
  145. * which we can look up in the db groups table with.)
  146. */
  147. function get_db_group_id() {
  148. // We expect our group_id to actually be the db_group_id + _ + degree_id.
  149. $temp = explode("_", $this->group_id);
  150. $db_group_id = trim($temp[0]);
  151. return $db_group_id;
  152. }
  153. function load_group($bool_load_significant_only = true, $array_significant_courses = false, $bool_reload_missing_only = false)
  154. {
  155. $this->load_descriptive_data();
  156. if ($this->db_delete_flag == 1)
  157. {
  158. return;
  159. }
  160. $bool_significant_courses_empty = true;
  161. if (is_array($array_significant_courses))
  162. {
  163. $bool_significant_courses_empty = false;
  164. }
  165. if ($bool_reload_missing_only == true)
  166. {
  167. // We are only going to load the *missing* courses from
  168. // this group. So, begin by getting an array of what is
  169. // not missing.
  170. $array_group_requirement_ids = $this->list_courses->get_group_requirement_id_array();
  171. //var_dump($array_group_requirement_ids);
  172. }
  173. $table_name = "group_requirements";
  174. if ($this->bool_use_draft) {$table_name = "draft_$table_name";}
  175. $res = db_query("SELECT * FROM `$table_name`
  176. WHERE group_id = '?' ", $this->get_db_group_id());
  177. while ($cur = db_fetch_array($res))
  178. {
  179. $id = $cur["id"];
  180. $course_id = $cur["course_id"]*1;
  181. if ($cur["course_id"]*1 > 0)
  182. {
  183. if ($bool_load_significant_only == true && $bool_significant_courses_empty == false)
  184. {
  185. // If this course_id is NOT in the array of significant courses
  186. // (that the student took or has transfer credit or subs for)
  187. // then skip it. Never add it to the group.
  188. if (isset($array_significant_courses[$cur["course_id"]]) && $array_significant_courses[$cur["course_id"]] != true)
  189. {// course was not in there, so skip!
  190. continue;
  191. }
  192. }
  193. // A course is the next requirement.
  194. // Is this more than XX repeats? If so, we consider it "infinite"
  195. if ($cur['course_repeats'] <= Group::GROUP_COURSE_INFINITE_REPEATS_THRESHOLD) {
  196. // Less than XX repeats, so treat it like a normal course.
  197. for ($t = 0; $t <= $cur["course_repeats"]; $t++)
  198. { // Add in the specified repeats for this group...
  199. // This will usually only go through the loop once.
  200. $use_id = $id . "_rep_$t";
  201. if ($bool_reload_missing_only == true)
  202. {
  203. // Only load this course if it is missing from the group.
  204. // Read the reload_missing_courses() method for an explanation
  205. // of why we should want to do this.
  206. // Basically, check all the courses in the current
  207. // list_courses object for a db_group_requirement_id of $id.
  208. // Only proceed if $id was NOT found.
  209. if (@$array_group_requirement_ids[$use_id] == true)
  210. {
  211. continue;
  212. }
  213. }
  214. $course_c = new Course();
  215. $course_c->bool_use_draft = $this->bool_use_draft;
  216. $course_c->course_id = $cur["course_id"];
  217. $course_c->db_group_requirement_id = $use_id;
  218. $course_c->db = $this->db;
  219. $course_c->catalog_year = $this->catalog_year;
  220. $course_c->assigned_to_group_id = $this->group_id;
  221. $course_c->assigned_to_semester_num = $this->assigned_to_semester_num;
  222. $course_c->specified_repeats = $cur["course_repeats"];
  223. if ($cur["course_repeats"] > 0)
  224. {
  225. $course_c->bool_specified_repeat = true;
  226. }
  227. $course_c->min_grade = trim(strtoupper($cur["course_min_grade"]));
  228. if ($course_c->min_grade == "")
  229. { // By default, all courses have a
  230. // min grade requirement of D.
  231. $course_c->min_grade = "D";
  232. }
  233. $this->list_courses->add($course_c);
  234. } // for t <= cur['course_repeats']
  235. }
  236. else {
  237. // We are dealing with a course with "infinite" repeats.
  238. $use_id = $id . "_rep_999";
  239. if ($bool_reload_missing_only == true)
  240. {
  241. // Only load this course if it is missing from the group.
  242. // Read the reload_missing_courses() method for an explanation
  243. // of why we should want to do this.
  244. // Basically, check all the courses in the current
  245. // list_courses object for a db_group_requirement_id of $id.
  246. // Only proceed if $id was NOT found.
  247. if (@$array_group_requirement_ids[$use_id] == true)
  248. {
  249. continue;
  250. }
  251. }
  252. $course_c = new Course();
  253. $course_c->bool_use_draft = $this->bool_use_draft;
  254. $course_c->course_id = $cur["course_id"];
  255. $course_c->db_group_requirement_id = $use_id;
  256. $course_c->db = $this->db;
  257. $course_c->catalog_year = $this->catalog_year;
  258. $course_c->assigned_to_group_id = $this->group_id;
  259. $course_c->assigned_to_semester_num = $this->assigned_to_semester_num;
  260. $course_c->specified_repeats = Group::GROUP_COURSE_INFINITE_REPEATS;
  261. $course_c->bool_specified_repeat = true;
  262. $course_c->min_grade = trim(strtoupper($cur["course_min_grade"]));
  263. if ($course_c->min_grade == "")
  264. { // By default, all courses have a
  265. // min grade requirement of D.
  266. $course_c->min_grade = "D";
  267. }
  268. $this->list_courses->add($course_c);
  269. }
  270. } // if cur['course_id']
  271. if ($cur["child_group_id"]*1 > 0)
  272. {
  273. $temp_add_as_new_group = FALSE;
  274. // Another group is the next requirement (its a branch)
  275. if ($bool_reload_missing_only == true)
  276. { // Since we are reloading courses, this subgroup is (probably) already
  277. // part of this group, so do not re-create it, just find it
  278. // and reload it's missing courses.
  279. $temp_g = new Group();
  280. $temp_g->bool_use_draft = $this->bool_use_draft;
  281. $temp_g->group_id = $cur["child_group_id"] . '_' . $this->req_by_degree_id;
  282. $temp_g->requirement_type = $this->requirement_type;
  283. if ($group_g = $this->list_groups->find_match($temp_g)) {
  284. $group_g->reload_missing_courses();
  285. }
  286. else {
  287. // We didn't find the child group, possibly because this is the first time we are loading it. If that is
  288. // the case, then we should just add it fresh.
  289. $temp_add_as_new_group = TRUE;
  290. }
  291. }
  292. else {
  293. $temp_add_as_new_group = TRUE;
  294. }
  295. if ($temp_add_as_new_group) {
  296. // Add this as a brand-new sub group, so create it
  297. // and add it to this group.
  298. $group_g = new Group($cur["child_group_id"] . "_" . $this->req_by_degree_id,null,$this->assigned_to_semester_num, $array_significant_courses, $this->bool_use_draft);
  299. $group_g->requirement_type = $this->requirement_type;
  300. $this->list_groups->add($group_g);
  301. }
  302. } // if child_group_id > 0
  303. } // while cur = db_fetch_array(res)
  304. // When we load this group, let's also check for any hooks.
  305. // Since this class might be used outside of FP, only do this if we know
  306. // that the bootstrap.inc file has been executed.
  307. if ($GLOBALS["fp_bootstrap_loaded"] == TRUE) {
  308. invoke_hook("group_load", array(&$this));
  309. }
  310. } // load_group
  311. function reload_missing_courses()
  312. {
  313. // This function will go through the group and reload
  314. // any courses which are missing from the group object,
  315. // but are spelled out in the database table.
  316. // This is used after we have loaded a group from
  317. // cache (because the cached group only contains
  318. // courses which the student has taken).
  319. $this->load_group(FALSE, FALSE, TRUE);
  320. }
  321. function replace_missing_course($course_id, $db_group_requirement_id="")
  322. {
  323. // replace course_id in this group, if it is missing.
  324. $table_name = "group_requirements";
  325. if ($this->bool_use_draft) {$table_name = "draft_$table_name";}
  326. // Look for all instances of this course in the group's base list...
  327. $res = db_query("SELECT `id`, course_repeats FROM `$table_name`
  328. WHERE group_id = ?
  329. AND course_id = ? ", $this->get_db_group_id(), $course_id);
  330. while ($cur = db_fetch_array($res))
  331. {
  332. $id = $cur["id"];
  333. for ($t = 0; $t <= $cur["course_repeats"]; $t++)
  334. {
  335. $course = new Course($course_id,false,$this->db, false, "", $this->bool_use_draft);
  336. $use_id = $id . "_rep_$t";
  337. // Make sure the group does not already have this requirementID...
  338. if ($this->list_courses->contains_group_requirement_id($use_id))
  339. {
  340. continue;
  341. }
  342. $course->assigned_to_group_id = $this->group_id;
  343. $course->requirement_type = $this->requirement_type;
  344. $course->db_group_requirement_id = $use_id;
  345. $course->specified_repeats = $cur["course_repeats"];
  346. if ($cur["course_repeats"] > 0)
  347. {
  348. $course->bool_specified_repeat = true;
  349. }
  350. $this->list_courses->add($course);
  351. }
  352. }
  353. // Now, go through all of the group's branches and
  354. // do the same thing.
  355. $this->list_groups->reset_counter();
  356. while($this->list_groups->has_more())
  357. {
  358. $g = $this->list_groups->get_next();
  359. $g->replace_missing_course($course_id);
  360. }
  361. }
  362. /**
  363. * Set all the courses and branches in this group to the specified degree_id.
  364. */
  365. function set_req_by_degree_id($degree_id = 0) {
  366. $this->req_by_degree_id = $degree_id;
  367. $this->list_courses->reset_counter();
  368. $this->list_courses->set_req_by_degree_id($degree_id);
  369. // go through sub-groups and do the same...
  370. $this->list_groups->reset_counter();
  371. while($this->list_groups->has_more())
  372. {
  373. $g = $this->list_groups->get_next();
  374. $g->set_req_by_degree_id($degree_id);
  375. }
  376. }
  377. /**
  378. * Sets the requirement type for the group and all its courses (including sub-groups)
  379. */
  380. function set_requirement_type($requirement_type = "") {
  381. $this->requirement_type = $requirement_type;
  382. $this->list_courses->reset_counter();
  383. $this->list_courses->set_requirement_type($requirement_type);
  384. // go through sub-groups and do the same...
  385. $this->list_groups->reset_counter();
  386. while($this->list_groups->has_more())
  387. {
  388. $g = $this->list_groups->get_next();
  389. $g->set_requirement_type($requirement_type);
  390. }
  391. }
  392. function load_descriptive_data()
  393. {
  394. $cur = null;
  395. static $group_descriptive_data_cache = array();
  396. if (isset($group_descriptive_data_cache[$this->get_db_group_id()])) {
  397. $cur = $group_descriptive_data_cache[$this->get_db_group_id()];
  398. }
  399. else {
  400. $table_name = "groups";
  401. if ($this->bool_use_draft) {$table_name = "draft_$table_name";}
  402. // Load information about the group's title, icon, etc.
  403. $res = db_query("SELECT *
  404. FROM `$table_name`
  405. WHERE group_id = ? ", $this->get_db_group_id());
  406. $cur = db_fetch_array($res);
  407. $group_descriptive_data_cache[$this->get_db_group_id()] = $cur;
  408. }
  409. $this->title = trim($cur["title"]);
  410. $this->icon_filename = trim($cur["icon_filename"]);
  411. $this->group_name = trim($cur["group_name"]);
  412. $this->data_entry_comment = trim($cur["data_entry_comment"]);
  413. $this->priority = trim($cur["priority"]);
  414. $this->definition = trim($cur["definition"]);
  415. $this->db_delete_flag = trim($cur["delete_flag"]);
  416. $this->db_catalog_repeat = trim($cur["catalog_repeat"]);
  417. $this->catalog_year = trim($cur["catalog_year"]);
  418. if ($this->group_id == -88)
  419. {
  420. $this->title = "Add an Additional Course";
  421. }
  422. }
  423. function get_fulfilled_hours($bool_check_subgroups = true, $bool_count_advised = true, $bool_require_has_been_displayed = false, $only_count_semester_num = -1, $bool_ignore_enrolled = false, $bool_qpts_grades_only = FALSE, $requirement_type = "", $bool_exclude_all_transfer_credits = FALSE)
  424. {
  425. // Returns how many hours have been used by the
  426. // course fulfillments for this group...
  427. $count = 0;
  428. // if onlyCountSemesterNum != -1, then we will only count courses
  429. // who have their "assigned_to_semester_num" = $only_count_semester_num.
  430. //print_pre($this->to_string());
  431. $this->list_courses->reset_counter();
  432. while($this->list_courses->has_more())
  433. {
  434. $c = $this->list_courses->get_next();
  435. if ($only_count_semester_num != -1 && $c->assigned_to_semester_num != $only_count_semester_num)
  436. {
  437. // Only accept courses assigned to a particular semester.
  438. continue;
  439. }
  440. if (is_object($c->course_list_fulfilled_by) && !($c->course_list_fulfilled_by->is_empty))
  441. {
  442. if ($bool_ignore_enrolled == true)
  443. {
  444. // Only allow it if it has been completed.
  445. if ($c->course_list_fulfilled_by->get_first()->is_completed() == false)
  446. {
  447. continue;
  448. }
  449. }
  450. if (!$bool_require_has_been_displayed)
  451. { // The course does not have to have been displayed on the page yet.
  452. $count = $count + $c->course_list_fulfilled_by->count_credit_hours($requirement_type, false, false, $bool_qpts_grades_only, $bool_exclude_all_transfer_credits);
  453. } else {
  454. if ($c->course_list_fulfilled_by->get_first()->get_has_been_displayed() == true)
  455. {
  456. $h = $c->course_list_fulfilled_by->count_credit_hours($requirement_type, false, false, $bool_qpts_grades_only, $bool_exclude_all_transfer_credits);
  457. $count = $count + $h;
  458. }
  459. }
  460. } else if ($c->bool_advised_to_take && $bool_count_advised == true)
  461. {
  462. $h = $c->get_hours();
  463. $count = $count + $h;
  464. }
  465. }
  466. if ($bool_check_subgroups == true)
  467. {
  468. // If there are any subgroups for this group, then run
  469. // this function for each group as well.
  470. $this->list_groups->reset_counter();
  471. while($this->list_groups->has_more())
  472. {
  473. $g = $this->list_groups->get_next();
  474. $gc = $g->get_fulfilled_hours(true, $bool_count_advised, $bool_require_has_been_displayed, $only_count_semester_num, $bool_ignore_enrolled, $bool_qpts_grades_only, $requirement_type, $bool_exclude_all_transfer_credits);
  475. $count = $count + $gc;
  476. }
  477. }
  478. //if ($this->group_id == 533404) {
  479. //fpm($this);
  480. //fpm("returning $count for group $this->group_id, $this->title");
  481. //}
  482. return $count;
  483. }
  484. /**
  485. * Returns the quality points earned for all of the courses in this group
  486. *
  487. */
  488. function get_fulfilled_quality_points($bool_check_subgroups = true, $only_count_semester_num = -1, $bool_ignore_enrolled = false, $bool_require_has_been_displayed = false, $requirement_type = "", $bool_exclude_all_transfer_credits = FALSE)
  489. {
  490. $points = 0;
  491. // if onlyCountSemesterNum != -1, then we will only count courses
  492. // who have their "assigned_to_semester_num" = $only_count_semester_num.
  493. $this->list_courses->reset_counter();
  494. while($this->list_courses->has_more())
  495. {
  496. $c = $this->list_courses->get_next();
  497. if ($only_count_semester_num != -1 && $c->assigned_to_semester_num != $only_count_semester_num)
  498. {
  499. // Only accept courses assigned to a particular semester.
  500. continue;
  501. }
  502. if (is_object($c->course_list_fulfilled_by) && !($c->course_list_fulfilled_by->is_empty))
  503. {
  504. if ($bool_ignore_enrolled == true)
  505. {
  506. // Only allow it if it has been completed.
  507. if ($c->course_list_fulfilled_by->get_first()->is_completed() == false)
  508. {
  509. continue;
  510. }
  511. }
  512. $p = 0;
  513. // Are we requiring that the course has been displayed?
  514. if (!$bool_require_has_been_displayed || ($bool_require_has_been_displayed && $c->course_list_fulfilled_by->get_first()->get_has_been_displayed() == TRUE))
  515. {
  516. $p = $c->course_list_fulfilled_by->count_credit_quality_points($requirement_type, TRUE, TRUE, $bool_exclude_all_transfer_credits);
  517. }
  518. $points = $points + $p;
  519. }
  520. }
  521. if ($bool_check_subgroups == TRUE)
  522. {
  523. // If there are any subgroups for this group, then run
  524. // this function for each group as well.
  525. $this->list_groups->reset_counter();
  526. while($this->list_groups->has_more())
  527. {
  528. $g = $this->list_groups->get_next();
  529. $gp = $g->get_fulfilled_quality_points(TRUE, $only_count_semester_num, $bool_ignore_enrolled, $bool_require_has_been_displayed, $requirement_type, $bool_exclude_all_transfer_credits);
  530. $points = $points + $gp;
  531. }
  532. }
  533. return $points;
  534. }
  535. function equals(Group $group, $bool_ignore_degree_id = FALSE)
  536. {
  537. $our_group_id = $this->group_id;
  538. $test_group_id = $group->group_id;
  539. if ($bool_ignore_degree_id) {
  540. $our_group_id = $this->get_db_group_id();
  541. $test_group_id = $group->get_db_group_id();
  542. }
  543. if ($our_group_id == $test_group_id)
  544. {
  545. return true;
  546. }
  547. return false;
  548. }
  549. function to_string()
  550. {
  551. $rtn = "";
  552. $rtn .= " Group: $this->group_id | $this->title $this->catalog_year ($this->hours_required hrs req.)\n {\n";
  553. if (!$this->list_courses->is_empty)
  554. {
  555. $rtn .= $this->list_courses->to_string();
  556. }
  557. if (!$this->list_groups->is_empty)
  558. {
  559. $rtn .= $this->list_groups->to_string();
  560. }
  561. $rtn .= " } \n";
  562. return $rtn;
  563. }
  564. function find_courses(Course $course)
  565. {
  566. // Return a CourseList of all the Course objects
  567. // which are in this group that match
  568. $rtn_course_list = new CourseList();
  569. if ($obj_list = $this->list_courses->find_all_matches($course))
  570. {
  571. $obj_list->reset_counter();
  572. while($obj_list->has_more())
  573. {
  574. $c = $obj_list->get_next();
  575. $c->required_on_branch_id = $this->group_id;
  576. }
  577. $rtn_course_list->add_list($obj_list);
  578. return $rtn_course_list;
  579. }
  580. return false;
  581. }
  582. } // end class Group