public static function getMemberCampaignData($campaignId) {
    $request = \Drupal::request();
    $session = $request->getSession();

    $openyCampaignSession = $session->get('openy_campaign', [
      'campaign_ids' => [],
      'member_ids' => [],
      'membership_ids' => [],
      'full_names' => [],
    ]);

    $membershipIDs = $openyCampaignSession['membership_ids'];
    $fullNames = $openyCampaignSession['full_names'];
    $memberIDs = $openyCampaignSession['member_ids'];

    return [
      'campaign_id' => $campaignId,
      'membership_id' => !empty($membershipIDs[$campaignId]) ? $membershipIDs[$campaignId] : '',
      'full_name' => !empty($fullNames[$campaignId]) ? $fullNames[$campaignId] : '',
      'member_id' => !empty($memberIDs[$campaignId]) ? $memberIDs[$campaignId] : '',
    ];
  }
public static function getMemberCampaignData($campaignId) {
    $request = \Drupal::request();
    $session = $request->getSession();

    $openyCampaignSession = $session->get('openy_campaign', [
      'campaign_ids' => [],
      'member_ids' => [],
      'membership_ids' => [],
      'full_names' => [],
    ]);

    $membershipIDs = $openyCampaignSession['membership_ids'];
    $fullNames = $openyCampaignSession['full_names'];
    $memberIDs = $openyCampaignSession['member_ids'];

    return [
      'campaign_id' => $campaignId,
      'membership_id' => !empty($membershipIDs[$campaignId]) ? $membershipIDs[$campaignId] : '',
      'full_name' => !empty($fullNames[$campaignId]) ? $fullNames[$campaignId] : '',
      'member_id' => !empty($memberIDs[$campaignId]) ? $memberIDs[$campaignId] : '',
    ];
  }
public static function getMemberCampaignData ( $ campaignId ) { $ request = \ Drupal :: request ( ) ; $ session = $ request -> getSession ( ) ; $ openyCampaignSession = $ session -> get ( 'openy_campaign' , [ 'campaign_ids' => [ ] , 'member_ids' => [ ] , 'membership_ids' => [ ] , 'full_names' => [ ] , ] ) ; $ membershipIDs = $ openyCampaignSession [ 'membership_ids' ] ; $ fullNames = $ openyCampaignSession [ 'full_names' ] ; $ memberIDs = $ openyCampaignSession [ 'member_ids' ] ; return [ 'campaign_id' => $ campaignId , 'membership_id' => ! empty ( $ membershipIDs [ $ campaignId ] ) ? $ membershipIDs [ $ campaignId ] : '' , 'full_name' => ! empty ( $ fullNames [ $ campaignId ] ) ? $ fullNames [ $ campaignId ] : '' , 'member_id' => ! empty ( $ memberIDs [ $ campaignId ] ) ? $ memberIDs [ $ campaignId ] : '' , ] ; }
Get campaign ids, membership id and full name from SESSION.

@param int $campaignId
Campaign node ID.

@return array MemberCampaign data from SESSION.
Get campaign ids membership id and full name from SESSION .