You are here

public function EventAnEnrollService::enrollmentCount in Open Social 8.5

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
  2. 8.6 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
  3. 8.7 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
  4. 8.8 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
  5. 10.3.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
  6. 10.0.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
  7. 10.1.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollService.php \Drupal\social_event_an_enroll\EventAnEnrollService::enrollmentCount()
  8. 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_enroll

Code

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();
}