private function getAllMembersDataForQueue() {
    /** @var \Drupal\Core\Database\Query\Select $query */
    $query = $this->connection->select('node_field_data', 'n');
    $query->condition('n.status', 1);
    $query->condition('n.type', 'campaign');

    $query->join('openy_campaign_member_campaign', 'mc', 'n.nid = mc.campaign');
    $query->addField('mc', 'member', 'member_id');

    $query->join('openy_campaign_member', 'm', 'mc.member = m.id');
    $query->addField('m', 'personify_id', 'personify_id');

    $query->join('node__field_campaign_start_date', 'ds', 'n.nid = ds.entity_id');
    $query->addField('ds', 'field_campaign_start_date_value', 'start_date');

    $query->join('node__field_campaign_end_date', 'de', 'n.nid = de.entity_id');
    $query->addField('de', 'field_campaign_end_date_value', 'end_date');

    $resArray = $query->execute()->fetchAll();

    $membersData = [];
    foreach ($resArray as $item) {
      // UTC dates from Drupal database.
      $startDate = \DateTime::createFromFormat('Y-m-d\TH:i:s', $item->start_date);
      $endDate = \DateTime::createFromFormat('Y-m-d\TH:i:s', $item->end_date);

      // Expand Member dates to fit all active campaigns.
      if (in_array($item->member_id, array_keys($membersData))) {
        $startDate = $membersData[$item->member_id]['start_date'] > $startDate ? $startDate : $membersData[$item->member_id]['start_date'];
        $endDate = $membersData[$item->member_id]['end_date'] < $endDate ? $endDate : $membersData[$item->member_id]['end_date'];
      }

      $startDate->setTime(0, 0, 0);

      $membersData[$item->member_id] = [
        'member_id' => $item->member_id,
        'master_customer_id' => $item->personify_id,
        'start_date' => $startDate,
        'end_date' => $endDate,
      ];
    }

    return $membersData;
  }
private function getAllMembersDataForQueue() {
    /** @var \Drupal\Core\Database\Query\Select $query */
    $query = $this->connection->select('node_field_data', 'n');
    $query->condition('n.status', 1);
    $query->condition('n.type', 'campaign');

    $query->join('openy_campaign_member_campaign', 'mc', 'n.nid = mc.campaign');
    $query->addField('mc', 'member', 'member_id');

    $query->join('openy_campaign_member', 'm', 'mc.member = m.id');
    $query->addField('m', 'personify_id', 'personify_id');

    $query->join('node__field_campaign_start_date', 'ds', 'n.nid = ds.entity_id');
    $query->addField('ds', 'field_campaign_start_date_value', 'start_date');

    $query->join('node__field_campaign_end_date', 'de', 'n.nid = de.entity_id');
    $query->addField('de', 'field_campaign_end_date_value', 'end_date');

    $resArray = $query->execute()->fetchAll();

    $membersData = [];
    foreach ($resArray as $item) {
      // UTC dates from Drupal database.
      $startDate = \DateTime::createFromFormat('Y-m-d\TH:i:s', $item->start_date);
      $endDate = \DateTime::createFromFormat('Y-m-d\TH:i:s', $item->end_date);

      // Expand Member dates to fit all active campaigns.
      if (in_array($item->member_id, array_keys($membersData))) {
        $startDate = $membersData[$item->member_id]['start_date'] > $startDate ? $startDate : $membersData[$item->member_id]['start_date'];
        $endDate = $membersData[$item->member_id]['end_date'] < $endDate ? $endDate : $membersData[$item->member_id]['end_date'];
      }

      $startDate->setTime(0, 0, 0);

      $membersData[$item->member_id] = [
        'member_id' => $item->member_id,
        'master_customer_id' => $item->personify_id,
        'start_date' => $startDate,
        'end_date' => $endDate,
      ];
    }

    return $membersData;
  }
private function getAllMembersDataForQueue ( ) { /** @var \Drupal\Core\Database\Query\Select $query */ $ query = $ this -> connection -> select ( 'node_field_data' , 'n' ) ; $ query -> condition ( 'n.status' , 1 ) ; $ query -> condition ( 'n.type' , 'campaign' ) ; $ query -> join ( 'openy_campaign_member_campaign' , 'mc' , 'n.nid = mc.campaign' ) ; $ query -> addField ( 'mc' , 'member' , 'member_id' ) ; $ query -> join ( 'openy_campaign_member' , 'm' , 'mc.member = m.id' ) ; $ query -> addField ( 'm' , 'personify_id' , 'personify_id' ) ; $ query -> join ( 'node__field_campaign_start_date' , 'ds' , 'n.nid = ds.entity_id' ) ; $ query -> addField ( 'ds' , 'field_campaign_start_date_value' , 'start_date' ) ; $ query -> join ( 'node__field_campaign_end_date' , 'de' , 'n.nid = de.entity_id' ) ; $ query -> addField ( 'de' , 'field_campaign_end_date_value' , 'end_date' ) ; $ resArray = $ query -> execute ( ) -> fetchAll ( ) ; $ membersData = [ ] ; foreach ( $ resArray as $ item ) { // UTC dates from Drupal database. $ startDate = \ DateTime :: createFromFormat ( 'Y-m-d\TH:i:s' , $ item -> start_date ) ; $ endDate = \ DateTime :: createFromFormat ( 'Y-m-d\TH:i:s' , $ item -> end_date ) ; // Expand Member dates to fit all active campaigns. if ( in_array ( $ item -> member_id , array_keys ( $ membersData ) ) ) { $ startDate = $ membersData [ $ item -> member_id ] [ 'start_date' ] > $ startDate ? $ startDate : $ membersData [ $ item -> member_id ] [ 'start_date' ] ; $ endDate = $ membersData [ $ item -> member_id ] [ 'end_date' ] < $ endDate ? $ endDate : $ membersData [ $ item -> member_id ] [ 'end_date' ] ; } $ startDate -> setTime ( 0 , 0 , 0 ) ; $ membersData [ $ item -> member_id ] = [ 'member_id' => $ item -> member_id , 'master_customer_id' => $ item -> personify_id , 'start_date' => $ startDate , 'end_date' => $ endDate , ] ; } return $ membersData ; }
Get all members data to create queue.

@return array
Get all members data to create queue .