public function PromotionUsage::reassign in Commerce Core 8.2
Reassigns usage to a new customer email.
Parameters
string $old_mail: The old customer email.
string $new_mail: The new customer email.
Overrides PromotionUsageInterface::reassign
File
- modules/
promotion/ src/ PromotionUsage.php, line 47
Class
Namespace
Drupal\commerce_promotionCode
public function reassign($old_mail, $new_mail) {
$this->connection
->update('commerce_promotion_usage')
->fields([
'mail' => $new_mail,
])
->condition('mail', $old_mail)
->execute();
}