You are here

public function PaymentGatewayBase::__wakeup in Commerce Core 8.2

Overrides DependencySerializationTrait::__wakeup

File

modules/payment/src/Plugin/Commerce/PaymentGateway/PaymentGatewayBase.php, line 161

Class

PaymentGatewayBase
Provides the base class for payment gateways.

Namespace

Drupal\commerce_payment\Plugin\Commerce\PaymentGateway

Code

public function __wakeup() {
  parent::__wakeup();
  if (!empty($this->_parentEntityId)) {
    $payment_gateway_storage = $this->entityTypeManager
      ->getStorage('commerce_payment_gateway');
    $this->parentEntity = $payment_gateway_storage
      ->load($this->_parentEntityId);
    unset($this->_parentEntityId);
  }
}