You are here

function course_get_course_object_by_id in Course 7.2

Same name and namespace in other branches
  1. 8.3 course.module \course_get_course_object_by_id()
  2. 8.2 course.module \course_get_course_object_by_id()
  3. 6 course.module \course_get_course_object_by_id()
  4. 7 course.module \course_get_course_object_by_id()
  5. 3.x course.module \course_get_course_object_by_id()

Get a course object by its identifier.

Parameters

int $coid: The numeric or temporary ID of the course object.

Return value

CourseObject|FALSE A loaded CourseObject or FALSE if no object found.

12 calls to course_get_course_object_by_id()
CourseObjectManualTestCase::testCourseObjectManual in modules/course_object_manual/course_object_manual.test
Test manual course object functionality.
CourseObjectSignupTestCase::testSignupCourseObject in modules/course_signup/course_signup.test
Test the fulfillment of an attendance object.
CourseObjectTestCase::testCourseObjectBasicCrud in tests/CourseObjectTestCase.test
Test basic save/load of CourseObjects.
CourseObjectTestCase::testCourseObjectConfigurations in tests/CourseObjectTestCase.test
Test CourseObject configurations.
CourseObjectUbercartTestCase::testDelayedPayment in modules/course_uc/course_uc.test

... See full list

File

./course.module, line 1515
course.module Core functionality for Courses.

Code

function course_get_course_object_by_id($coid) {
  if (!is_numeric($coid)) {
    return _course_get_course_object_by_uniqid($coid);
  }
  if ($courseObject = entity_load_single('course_object', $coid)) {
    return $courseObject;
  }
  return FALSE;
}