commerce_xero-8.x-1.x-dev/commerce_xero.module
commerce_xero.module
<?php
/**
* @file
* Commerce Xero.
*/
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
/**
* Implements hook_entity_base_field_info().
*/
function commerce_xero_entity_base_field_info(EntityTypeInterface $entity_type) {
$fields = [];
if ($entity_type->id() === 'commerce_payment') {
$fields['xero_transaction'] = BaseFieldDefinition::create('xero_reference')
->setLabel(t('Xero transactions'))
->setCardinality(-1)
->setRequired(FALSE)
->setTranslatable(FALSE);
}
return $fields;
}
