public function EventAnEnrollService::enrollmentCount in Open Social 8.7
Same name and namespace in other branches
- 8.9 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
- 8.5 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
- 8.6 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
- 8.8 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
- 10.3.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
- 10.0.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
- 10.1.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
- 10.2.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
Returns number of anonymous enrollments.
Parameters
int $nid: The node ID.
Return value
int The number of anonymous event enrollments.
File
- modules/
social_features/ social_event/ modules/ social_event_an_enroll/ src/ EventAnEnrollService.php, line 60
Class
- EventAnEnrollService
- Class EventAnEnrollService.
Namespace
Drupal\social_event_an_enrollCode
public function enrollmentCount($nid) {
$query = $this->database
->select('event_enrollment__field_account', 'eefa');
$query
->join('event_enrollment__field_event', 'eefe', 'eefa.entity_id = eefe.entity_id');
$query
->condition('eefa.field_account_target_id', 0);
$query
->condition('eefe.field_event_target_id', $nid);
return (int) $query
->countQuery()
->execute()
->fetchField();
}