function Course::get_first_value_from_any_degree

7.x Course.php Course::get_first_value_from_any_degree($key)
6.x Course.php Course::get_first_value_from_any_degree($key)

Goes through the details_by_degree array and returns the first valid value for the supplied key, any degree., or return NULL if not found.

1 call to Course::get_first_value_from_any_degree()
Course::get_hours_awarded in classes/Course.php
If the boolean is set, it means if the supplied degree_id isn't set, then use the first found value.

File

classes/Course.php, line 372

Class

Course

Code

function get_first_value_from_any_degree($key) {

  foreach ($this->details_by_degree_array as $d => $v) {
    if (isset($v [$key])) {
      return $v [$key];
    }
  }

  // Found nothing, return null
  return NULL;
}