You are here

class MailchimpCommands in Mailchimp 2.x

Class MailchimpCommands provides Drush commands.

@package Drupal\mailchimp\Commands

Hierarchy

  • class \Drupal\mailchimp\Commands\MailchimpCommands extends \Drush\Commands\DrushCommands

Expanded class hierarchy of MailchimpCommands

1 string reference to 'MailchimpCommands'
drush.services.yml in ./drush.services.yml
drush.services.yml
1 service uses MailchimpCommands
mailchimp.commands in ./drush.services.yml
Drupal\mailchimp\Commands\MailchimpCommands

File

src/Commands/MailchimpCommands.php, line 12

Namespace

Drupal\mailchimp\Commands
View source
class MailchimpCommands extends DrushCommands {

  /**
   * This command will trigger Mailchimp Cron jobs.
   *
   * @param int $temp_batchsize
   *   Optional max size of batch. If ommitted, will use configuration.
   *
   * @command mailchimp:cron
   * @aliases mcc mailchimp-cron
   *
   * @usage drush mailchimp:cron
   *  Trigger mailchimp cron jobs with configured batch size
   *
   * @usage drush mailchimp:cron 50
   *  Trigger up to 50 mailchimp cron jobs
   */
  public function cron(int $temp_batchsize) : string {
    $result = mailchimp_cron($temp_batchsize);
    return 'Mailchimp cron jobs triggered: ' . $result;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MailchimpCommands::cron public function This command will trigger Mailchimp Cron jobs.