private function getActiveCampaignMembers() {
    // Get the list of all active campaigns.
    $currentDate = new DrupalDateTime('now');
    $currentDate->setTimezone(new \DateTimezone(DATETIME_STORAGE_TIMEZONE));
    $formatted = $currentDate->format(DATETIME_DATETIME_STORAGE_FORMAT);

    $campaigns = \Drupal::entityQuery('node')
      ->condition('type', 'campaign')
      ->condition('field_campaign_start_date', $formatted, '<=')
      ->condition('field_campaign_end_date', $formatted, '>=')
      ->execute();

    // Check if the member still exists.
    $memberId = NULL;
    if (empty($this->get('member')->entity)) {
      return [];
    }
    $memberId = $this->get('member')->entity->id();

    $campaignMembers = \Drupal::entityQuery('openy_campaign_member_campaign')
      ->condition('campaign', array_values($campaigns), 'IN')
      ->condition('member', $memberId)
      ->execute();

    return $campaignMembers;
  }
private function getActiveCampaignMembers() {
    // Get the list of all active campaigns.
    $currentDate = new DrupalDateTime('now');
    $currentDate->setTimezone(new \DateTimezone(DATETIME_STORAGE_TIMEZONE));
    $formatted = $currentDate->format(DATETIME_DATETIME_STORAGE_FORMAT);

    $campaigns = \Drupal::entityQuery('node')
      ->condition('type', 'campaign')
      ->condition('field_campaign_start_date', $formatted, '<=')
      ->condition('field_campaign_end_date', $formatted, '>=')
      ->execute();

    // Check if the member still exists.
    $memberId = NULL;
    if (empty($this->get('member')->entity)) {
      return [];
    }
    $memberId = $this->get('member')->entity->id();

    $campaignMembers = \Drupal::entityQuery('openy_campaign_member_campaign')
      ->condition('campaign', array_values($campaigns), 'IN')
      ->condition('member', $memberId)
      ->execute();

    return $campaignMembers;
  }
private function getActiveCampaignMembers ( ) { // Get the list of all active campaigns. $ currentDate = new DrupalDateTime ( 'now' ) ; $ currentDate -> setTimezone ( new \ DateTimezone ( DATETIME_STORAGE_TIMEZONE ) ) ; $ formatted = $ currentDate -> format ( DATETIME_DATETIME_STORAGE_FORMAT ) ; $ campaigns = \ Drupal :: entityQuery ( 'node' ) -> condition ( 'type' , 'campaign' ) -> condition ( 'field_campaign_start_date' , $ formatted , '<=' ) -> condition ( 'field_campaign_end_date' , $ formatted , '>=' ) -> execute ( ) ; // Check if the member still exists. $ memberId = NULL ; if ( empty ( $ this -> get ( 'member' ) -> entity ) ) { return [ ] ; } $ memberId = $ this -> get ( 'member' ) -> entity -> id ( ) ; $ campaignMembers = \ Drupal :: entityQuery ( 'openy_campaign_member_campaign' ) -> condition ( 'campaign' , array_values ( $ campaigns ) , 'IN' ) -> condition ( 'member' , $ memberId ) -> execute ( ) ; return $ campaignMembers ; }
Get the list of members of all active campaigns.

@return array
Get the list of members of all active campaigns .