public function Course::getTracker in Course 3.x
Same name and namespace in other branches
- 8.3 src/Entity/Course.php \Drupal\course\Entity\Course::getTracker()
- 8.2 src/Entity/Course.php \Drupal\course\Entity\Course::getTracker()
Get the course tracker for this course/user.
Return value
Deprecated
use getEnrollment()
File
- src/
Entity/ Course.php, line 107
Class
- Course
- Defines the Course entity class.
Namespace
Drupal\course\EntityCode
public function getTracker(AccountInterface $account) {
$entities = \Drupal::entityTypeManager()
->getStorage('course_enrollment')
->loadByProperties([
'cid' => $this
->id(),
'uid' => $account
->id(),
]);
if ($entities) {
return reset($entities);
}
return FALSE;
}