modules/acm_promotion/src/Commands/AcmPromotionCommands.php
public function synPromotions(array $options = ['types' => NULL]) {
    if ($types = $options['types']) {
      $this->logger->notice(dt('Synchronizing all @types commerce promotions, this usually takes some time...', ['@types' => $types]));
      $types = explode(',', $types);
      $types = array_map('trim', $types);
      $this->acmPromotionsManager->syncPromotions($types);
    }
    else {
      $this->logger->notice(dt('Synchronizing all commerce promotions, this usually takes some time...'));
      $this->acmPromotionsManager->syncPromotions();
    }

    $this->logger->notice(dt('Promotion sync completed.'));
  }
public function synPromotions(array $options = ['types' => NULL]) {
    if ($types = $options['types']) {
      $this->logger->notice(dt('Synchronizing all @types commerce promotions, this usually takes some time...', ['@types' => $types]));
      $types = explode(',', $types);
      $types = array_map('trim', $types);
      $this->acmPromotionsManager->syncPromotions($types);
    }
    else {
      $this->logger->notice(dt('Synchronizing all commerce promotions, this usually takes some time...'));
      $this->acmPromotionsManager->syncPromotions();
    }

    $this->logger->notice(dt('Promotion sync completed.'));
  }
public function synPromotions ( array $ options = [ 'types' => NULL ] ) { if ( $ types = $ options [ 'types' ] ) { $ this -> logger -> notice ( dt ( 'Synchronizing all @types commerce promotions, this usually takes some time...' , [ '@types' => $ types ] ) ) ; $ types = explode ( ',' , $ types ) ; $ types = array_map ( 'trim' , $ types ) ; $ this -> acmPromotionsManager -> syncPromotions ( $ types ) ; } else { $ this -> logger -> notice ( dt ( 'Synchronizing all commerce promotions, this usually takes some time...' ) ) ; $ this -> acmPromotionsManager -> syncPromotions ( ) ; } $ this -> logger -> notice ( dt ( 'Promotion sync completed.' ) ) ; }
Run a full synchronization of all commerce promotion records.

@param array $options
Command Options.

@command acm_promotion:sync-promotions

@option types Type of promotions that need to be synced.

@validate-module-enabled acm_promotion

@aliases acspm,sync-commerce-promotions

@usage drush acspm
Run a full synchronization of all available promotions.
@usage drush acspm --types=cart
Run a full synchronization of all available cart promotions.
Run a full synchronization of all commerce promotion records .