You are here

function paymentmethodbasic_payment_method_insert in Payment 7

Implements hook_ENTITY_TYPE_ACTION().

File

modules/paymentmethodbasic/paymentmethodbasic.module, line 43
Hook implementations and shared functions.

Code

function paymentmethodbasic_payment_method_insert(PaymentMethod $payment_method) {
  if ($payment_method->controller->name == 'PaymentMethodBasicController') {
    $payment_method->controller_data += $payment_method->controller->controller_data_defaults;
    $query = db_insert('paymentmethodbasic');
    $values = array_merge($payment_method->controller_data, array(
      'pmid' => $payment_method->pmid,
    ));
    $query
      ->fields($values);
    $query
      ->execute();
  }
}