function Course::isEnrolled in Course 3.x
Same name and namespace in other branches
- 8.3 src/Entity/Course.php \Drupal\course\Entity\Course::isEnrolled()
- 8.2 src/Entity/Course.php \Drupal\course\Entity\Course::isEnrolled()
Check if a user is enrolled.
Parameters
AccountInterface $account: Account to check.
Return value
bool If the user is enrolled.
File
- src/
Entity/ Course.php, line 440
Class
- Course
- Defines the Course entity class.
Namespace
Drupal\course\EntityCode
function isEnrolled(AccountInterface $account) {
return (bool) $this
->getEnrollment($account);
}