function DegreePlan::get_major_code_csv

7.x DegreePlan.php DegreePlan::get_major_code_csv()
6.x DegreePlan.php DegreePlan::get_major_code_csv()

Returns back a CSV of all the major codes that this degree comprises

File

classes/DegreePlan.php, line 787

Class

DegreePlan

Code

function get_major_code_csv() {
  if (!$this->is_combined_dynamic_degree_plan) {
    return $this->major_code; // just a basic single non-combined degree.
  }

  // Otherwise, we should assume this is a combined dynamic degree.
  $rtn = "";

  foreach ($this->combined_degree_ids_array as $degree_id) {
    $t_degree_plan = new DegreePlan($degree_id);
    $rtn .= $t_degree_plan->major_code . ",";
  }

  $rtn = rtrim($rtn, ","); // remove last comma, if its there.

  return $rtn;

}