You are here

function course_get_course_object_by_id in Course 8.3

Same name and namespace in other branches
  1. 8.2 course.module \course_get_course_object_by_id()
  2. 6 course.module \course_get_course_object_by_id()
  3. 7.2 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.

@todo move to Storage?

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.

8 calls to course_get_course_object_by_id()
CourseObjectManualTestCase::testCourseObjectManual in modules/course_object_manual/tests/src/Functional/CourseObjectManualTestCase.php
Test manual course object functionality.
CourseObjectTestCase::testCourseObjectBasicCrud in tests/src/Functional/CourseObjectTestCase.php
Test basic save/load of CourseObjects.
CourseObjectTestCase::testCourseObjectConfigurations in tests/src/Functional/CourseObjectTestCase.php
Test CourseObject configurations.
CourseObjectUbercartTestCase::testDelayedPayment in modules/course_uc/course_uc.test
CourseOutlineForm::buildForm in src/Form/CourseOutlineForm.php
Form constructor.

... See full list

File

./course.module, line 406
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);
  }
  $courseObject = CourseObject::load($coid);
  if ($courseObject) {
    return $courseObject;
  }
  return FALSE;
}