public static function Signup::baseFieldDefinitions in SendinBlue 8.2
Same name and namespace in other branches
- 8 src/Entity/Signup.php \Drupal\sendinblue\Entity\Signup::baseFieldDefinitions()
Define the field properties here.
Field name, type and size determine the table structure.
In addition, we can define how the field and its content can be manipulated in the GUI. The behaviour of the widgets used can be determined here.
Overrides ContentEntityBase::baseFieldDefinitions
File
- src/
Entity/ Signup.php, line 54
Class
- Signup
- Defines the Contact entity.
Namespace
Drupal\sendinblue\EntityCode
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
// Standard field, used as unique if primary index.
$fields['mcsId'] = BaseFieldDefinition::create('integer')
->setLabel(t('ID'))
->setDescription(t('The ID of the Contact entity.'))
->setReadOnly(TRUE);
$fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Name'))
->setDescription(t('The name of the Contact entity.'))
->setSettings([
'default_value' => '',
'max_length' => 32,
'text_processing' => 0,
])
->setDisplayOptions('view', [
'label' => 'above',
'type' => 'string',
'weight' => 1,
])
->setDisplayConfigurable('view', TRUE);
$fields['mcLists'] = BaseFieldDefinition::create('map')
->setLabel(t('settings'))
->setDescription(t('The ID of the Contact entity.'));
$fields['mode'] = BaseFieldDefinition::create('integer')
->setLabel(t('mode'))
->setDescription(t('The ID of the Contact entity.'));
$fields['title'] = BaseFieldDefinition::create('string')
->setLabel(t('Title'))
->setDescription(t('The name of the Contact entity.'))
->setSettings([
'default_value' => '',
'max_length' => 32,
'text_processing' => 0,
])
->setDisplayOptions('view', [
'label' => 'above',
'type' => 'string',
'weight' => 0,
])
->setDisplayConfigurable('view', TRUE);
$fields['settings'] = BaseFieldDefinition::create('map')
->setLabel(t('settings'))
->setDescription(t('The ID of the Contact entity.'));
$fields['status'] = BaseFieldDefinition::create('integer')
->setLabel(t('status'))
->setDescription(t('The ID of the Contact entity.'))
->setDefaultValue(1);
$fields['module'] = BaseFieldDefinition::create('string')
->setLabel(t('module'))
->setDescription(t('The name of the Contact entity.'));
return $fields;
}