public function EventEnrollmentStatusHelper::getAllUserEventEnrollments in Open Social 10.3.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_event/src/EventEnrollmentStatusHelper.php \Drupal\social_event\EventEnrollmentStatusHelper::getAllUserEventEnrollments()
- 10.0.x modules/social_features/social_event/src/EventEnrollmentStatusHelper.php \Drupal\social_event\EventEnrollmentStatusHelper::getAllUserEventEnrollments()
- 10.1.x modules/social_features/social_event/src/EventEnrollmentStatusHelper.php \Drupal\social_event\EventEnrollmentStatusHelper::getAllUserEventEnrollments()
- 10.2.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_eventCode
public function getAllUserEventEnrollments($user) {
$conditions = $this
->userEnrollments($user, NULL);
unset($conditions['field_event']);
return $this->entityTypeManager
->getStorage('event_enrollment')
->loadByProperties($conditions);
}