You are here

function mollie_payment_entity_base_field_info in Mollie Payment 8.2

Implements hook_entity_base_field_info().

We need an additional field for each payment to store the Mollie payment id.

File

./mollie_payment.module, line 17
Provides Mollie integration for the Payment platform.

Code

function mollie_payment_entity_base_field_info(EntityTypeInterface $entity_type) {
  if ($entity_type
    ->id() == 'payment') {
    $fields = [];
    $fields['mollie_payment_id'] = BaseFieldDefinition::create('string')
      ->setLabel(t('Mollie payment id'))
      ->setDescription(t('The payment id in Mollie.'))
      ->setReadOnly(TRUE);
    return $fields;
  }
}