$fields['photos_number'] = BaseFieldDefinition::create('list_integer') ->setLabel(t('Nombre de photos autorisées')) ->setRequired(TRUE) ->setSettings(array( 'allowed_values' => [ 1 => t('1 photo'), 2 => t('2 photos'), 3 => t('3 photos'), ], )) ->setDefaultValue('public') ->setDisplayOptions('form', array( 'type' => 'options_buttons', )) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', FALSE);
Ajouter un commentaire