You are here

function CourseEnrollment::getCourse in Course 8.2

Same name and namespace in other branches
  1. 8.3 src/Entity/CourseEnrollment.php \Drupal\course\Entity\CourseEnrollment::getCourse()
  2. 3.x src/Entity/CourseEnrollment.php \Drupal\course\Entity\CourseEnrollment::getCourse()

Get the Course for this enrollment.

Return value

Course

1 call to CourseEnrollment::getCourse()
CourseEnrollment::preSave in src/Entity/CourseEnrollment.php
If a duration is set on the course, apply it to this enrollment.

File

src/Entity/CourseEnrollment.php, line 188

Class

CourseEnrollment
Defines the profile entity class.

Namespace

Drupal\course\Entity

Code

function getCourse() {
  return Course::load($this
    ->get('cid')
    ->getString());
}