function Course::get_first_assigned_to_group_id

6.x Course.php Course::get_first_assigned_to_group_id()
7.x Course.php Course::get_first_assigned_to_group_id()

Return the first element in our assigned_to_group_ids_array, or FALSE

File

classes/Course.php, line 2077

Class

Course

Code

function get_first_assigned_to_group_id() {

  if (count($this->assigned_to_group_ids_array) < 1) {
    return FALSE;
  }

  // Otherwise, get it.
  $x = reset($this->assigned_to_group_ids_array); // returns the first element.
  if ($x == 0) { // not a valid group_id number
    return FALSE;
  }

  // Otherwise, return x   
  return $x;

}