You are here

public function EventEnrollmentStatusHelper::getAllUserEventEnrollments in Open Social 10.2.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/src/EventEnrollmentStatusHelper.php \Drupal\social_event\EventEnrollmentStatusHelper::getAllUserEventEnrollments()
  2. 10.3.x modules/social_features/social_event/src/EventEnrollmentStatusHelper.php \Drupal\social_event\EventEnrollmentStatusHelper::getAllUserEventEnrollments()
  3. 10.0.x modules/social_features/social_event/src/EventEnrollmentStatusHelper.php \Drupal\social_event\EventEnrollmentStatusHelper::getAllUserEventEnrollments()
  4. 10.1.x modules/social_features/social_event/src/EventEnrollmentStatusHelper.php \Drupal\social_event\EventEnrollmentStatusHelper::getAllUserEventEnrollments()

Custom check to see if a user has enrollments.

Parameters

string $user: The email or userid you want to check on.

Return value

bool|\Drupal\Core\Entity\EntityInterface|mixed Returns all the enrollments for a user.

File

modules/social_features/social_event/src/EventEnrollmentStatusHelper.php, line 152

Class

EventEnrollmentStatusHelper
Class EventEnrollmentStatusHelper.

Namespace

Drupal\social_event

Code

public function getAllUserEventEnrollments($user) {
  $conditions = $this
    ->userEnrollments($user, NULL);
  unset($conditions['field_event']);
  return $this->entityTypeManager
    ->getStorage('event_enrollment')
    ->loadByProperties($conditions);
}