function _Course::get_count_details_by_degree

5.x _Course.php _Course::get_count_details_by_degree($property_name, $check_for_specific_value = NULL)

Return back a count from ANY degree for this property name.

6 calls to _Course::get_count_details_by_degree()
_Course::get_bool_exclude_repeat in classes/_Course.php
Returns TRUE or FALSE if this course has been marked as exclude_repeat. Specify a degree_id to be more specific. Use -1 to mean "ANY" degree?
_Course::get_bool_outdated_sub in classes/_Course.php
_Course::get_bool_substitution in classes/_Course.php
Similar to the functions regarding display, these will say if this course has been used in a substitution for a particular degree.
_Course::get_bool_substitution_new_from_split in classes/_Course.php
_Course::get_bool_substitution_split in classes/_Course.php

... See full list

File

classes/_Course.php, line 423

Class

_Course

Code

function get_count_details_by_degree($property_name, $check_for_specific_value = NULL) {
  $c = 0;
  foreach ($this->details_by_degree_array as $degree_id => $temp) {
    if (isset($temp [$property_name])) {

      if ($check_for_specific_value !== NULL) {
        // We want to SKIP if this property does not have this specific value
        if ($temp [$property_name] !== $check_for_specific_value) {
          continue;
        }
      }

      $c++;
    }
  }
  return $c;
}