PaymentStatusItem.php in Payment 8.2
File
src/Plugin/Field/FieldType/PaymentStatusItem.php
View source
<?php
namespace Drupal\payment\Plugin\Field\FieldType;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\TypedData\DataDefinition;
class PaymentStatusItem extends PaymentAwarePluginCollectionItem {
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties = parent::propertyDefinitions($field_definition);
$properties['created'] = DataDefinition::create('payment_status_created')
->setLabel(t('Created'));
return $properties;
}
public static function schema(FieldStorageDefinitionInterface $field_definition) {
$schema = parent::schema($field_definition);
$schema['columns']['created'] = [
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'unsigned' => TRUE,
];
return $schema;
}
}