You are here

function mailchimp_campaign_load_multiple in Mailchimp 8

Same name and namespace in other branches
  1. 7.5 modules/mailchimp_campaign/mailchimp_campaign.module \mailchimp_campaign_load_multiple()
  2. 7.2 modules/mailchimp_campaign/mailchimp_campaign.entity.inc \mailchimp_campaign_load_multiple()
  3. 7.3 modules/mailchimp_campaign/mailchimp_campaign.module \mailchimp_campaign_load_multiple()
  4. 7.4 modules/mailchimp_campaign/mailchimp_campaign.module \mailchimp_campaign_load_multiple()
  5. 2.x modules/mailchimp_campaign/mailchimp_campaign.module \mailchimp_campaign_load_multiple()

Loads multiple campaigns.

1 call to mailchimp_campaign_load_multiple()
MailchimpCampaignController::overview in modules/mailchimp_campaign/src/Controller/MailchimpCampaignController.php

File

modules/mailchimp_campaign/mailchimp_campaign.module, line 508
Module file for mailchimp_campaign.

Code

function mailchimp_campaign_load_multiple($campaign_ids = [], $reset = FALSE) {
  if (empty($campaign_ids)) {
    $campaign_ids = Drupal::entityQuery('mailchimp_campaign')
      ->sort('created', 'DESC')
      ->execute();
  }
  $controller = \Drupal::entityTypeManager()
    ->getStorage('mailchimp_campaign');
  if ($reset) {
    $controller
      ->resetCache($campaign_ids);
  }
  return $controller
    ->loadMultiple($campaign_ids);
}