You are here

function course_get_course in Course 8.3

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

Get the Course that a Node references.

Parameters

Node $node: The node object.

stdClass $account: The user with which to instantiate course objects and fulfillment.

Return value

Course|boolean The Course entity, or FALSE if provided node was not a Course.

15 calls to course_get_course()
CourseEnrollmentEditAction::buildConfigurationForm in src/Plugin/Action/CourseEnrollmentEditAction.php
CourseEnrollmentEditAction::execute in src/Plugin/Action/CourseEnrollmentEditAction.php
CourseObjectManualTestCase::testCourseObjectManual in modules/course_object_manual/tests/src/Functional/CourseObjectManualTestCase.php
Test manual course object functionality.
CourseObjectUbercartTestCase::testDelayedPayment in modules/course_uc/course_uc.test
course_ajaj_fulfullment_check in ./course.module
Fulfillment check callback.

... See full list

File

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

Code

function course_get_course(Node $node) {
  if (course_node_is_course($node)) {
    if ($course = $node->field_course->entity) {
      return $course;
    }
  }
  return FALSE;
}