You are here

function Course::unEnroll in Course 3.x

Same name and namespace in other branches
  1. 8.3 src/Entity/Course.php \Drupal\course\Entity\Course::unEnroll()
  2. 8.2 src/Entity/Course.php \Drupal\course\Entity\Course::unEnroll()

Remove a user from this course.

Parameters

AccountInterface $account:

File

src/Entity/Course.php, line 475

Class

Course
Defines the Course entity class.

Namespace

Drupal\course\Entity

Code

function unEnroll(AccountInterface $account) {
  return $this
    ->getEnrollment($account)
    ->delete();
}