public static function Payment::postDelete in Commerce Core 8.2
Acts on deleted entities before the delete hook is invoked.
Used after the entities are deleted but before invoking the delete hook.
Parameters
\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object.
\Drupal\Core\Entity\EntityInterface[] $entities: An array of entities.
Overrides EntityBase::postDelete
File
- modules/
payment/ src/ Entity/ Payment.php, line 368
Class
- Payment
- Defines the payment entity class.
Namespace
Drupal\commerce_payment\EntityCode
public static function postDelete(EntityStorageInterface $storage, array $entities) {
parent::postDelete($storage, $entities);
$payment_order_updater = \Drupal::service('commerce_payment.order_updater');
foreach ($entities as $entity) {
if ($order = $entity
->getOrder()) {
$payment_order_updater
->requestUpdate($order);
}
}
}