You are here

public function PromotionUsage::delete in Commerce Core 8.2

Deletes all usage for the given promotions.

Parameters

\Drupal\commerce_promotion\Entity\PromotionInterface[] $promotions: The promotions.

Overrides PromotionUsageInterface::delete

File

modules/promotion/src/PromotionUsage.php, line 57

Class

PromotionUsage

Namespace

Drupal\commerce_promotion

Code

public function delete(array $promotions) {
  $this->connection
    ->delete('commerce_promotion_usage')
    ->condition('promotion_id', EntityHelper::extractIds($promotions), 'IN')
    ->execute();
}