You are here

protected function PaymentStorageSchema::alterEntitySchemaWithNonFieldColumns in Payment 8.2

Adds non-field columns to the schema.

Parameters

array[] $schema: The existing schema.

1 call to PaymentStorageSchema::alterEntitySchemaWithNonFieldColumns()
PaymentStorageSchema::getEntitySchema in src/Entity/Payment/PaymentStorageSchema.php
Gets the entity schema for the specified entity type.

File

src/Entity/Payment/PaymentStorageSchema.php, line 29

Class

PaymentStorageSchema
Provides a payment storage schema handler.

Namespace

Drupal\payment\Entity\Payment

Code

protected function alterEntitySchemaWithNonFieldColumns(array &$schema) {
  $schema['payment']['fields'] += array(
    'current_payment_status_delta' => array(
      'description' => "The {payment__payment_statuses}.delta of this payment's current status item.",
      'type' => 'int',
      'unsigned' => TRUE,
      'default' => 0,
      'not null' => TRUE,
    ),
  );
  $schema['payment']['foreign keys'] += array(
    'current_payment_status_delta' => array(
      'table' => 'payment__payment_statuses',
      'columns' => array(
        'current_payment_status_delta' => 'delta',
      ),
    ),
    'owner' => array(
      'table' => 'user',
      'columns' => array(
        'owner' => 'uid',
      ),
    ),
  );
}