Field types are defined using the plugin system. Each field type has its own class and definition. A new field type can be defined through a custom class that will provide schema and property information.
In this example, we will create a simple field type called real name to store the first and last names.
Note
Field types define ways in which data can be stored and handled through the Field API. Field widgets provides means for editing a field type in the user interface. Field formatters provide means for displaying the field data to users. Both are plugins and will be covered in later recipes.
Create a new module like the one shown in this recipe, with a defined info.yml
so that it can be discovered by Drupal. We will refer to the module as mymodule
throughout the recipe. Use your module's appropriate name.