Guest User

Untitled

a guest
Oct 20th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. namespace DrupalnflEntity;
  2.  
  3. use DrupalCoreEntityEntityStorageInterface;
  4. use DrupalCoreFieldBaseFieldDefinition;
  5. use DrupalCoreEntityContentEntityBase;
  6. use DrupalCoreEntityEntityTypeInterface;
  7. use DrupalnflFactInterface;
  8. use DrupaluserUserInterface;
  9. use DrupalCoreEntityEntityChangedTrait;
  10.  
  11. $fields['flouride'] = BaseFieldDefinition::create('integer')
  12. ->setLabel(t('Flouride'))
  13. ->setRequired(FALSE)
  14. ->setSettings(array('default_value' => 0, 'suffix' => 'g', 'max_length' => 8, 'min' => 0, 'text_processing' => 0))
  15. ->setDisplayOptions('view', array('label' => 'inline', 'type' => 'number', 'weight' => 24))
  16. ->setDisplayOptions('form', array('type' => 'number', 'weight' => 24))
  17. ->setDisplayConfigurable('form', TRUE)
  18. ->setDisplayConfigurable('view', TRUE);
Add Comment
Please, Sign In to add comment