class FieldType
Same name in this branch
- 11.x core/modules/field/src/Plugin/migrate/process/FieldType.php \Drupal\field\Plugin\migrate\process\FieldType
- 11.x core/lib/Drupal/Core/Field/Attribute/FieldType.php \Drupal\Core\Field\Attribute\FieldType
Same name in other branches
- 9 core/modules/field/src/Plugin/migrate/process/FieldType.php \Drupal\field\Plugin\migrate\process\FieldType
- 9 core/lib/Drupal/Core/Field/Annotation/FieldType.php \Drupal\Core\Field\Annotation\FieldType
- 8.9.x core/modules/field/src/Plugin/migrate/process/FieldType.php \Drupal\field\Plugin\migrate\process\FieldType
- 8.9.x core/lib/Drupal/Core/Field/Annotation/FieldType.php \Drupal\Core\Field\Annotation\FieldType
- 10 core/modules/field/src/Plugin/migrate/process/FieldType.php \Drupal\field\Plugin\migrate\process\FieldType
- 10 core/lib/Drupal/Core/Field/Annotation/FieldType.php \Drupal\Core\Field\Annotation\FieldType
- 10 core/lib/Drupal/Core/Field/Attribute/FieldType.php \Drupal\Core\Field\Attribute\FieldType
Defines a FieldType annotation object.
Additional annotation keys for field types can be defined in hook_field_info_alter().
Hierarchy
- class \Drupal\Component\Annotation\Plugin implements \Drupal\Component\Annotation\AnnotationInterface
Expanded class hierarchy of FieldType
Related topics
1 class is annotated with FieldType
- DeprecatedReferenceItem in core/
modules/ jsonapi/ tests/ modules/ jsonapi_test_reference_types/ src/ Plugin/ Field/ FieldType/ DeprecatedReferenceItem.php - Entity reference field type which doesn't implement the standard interface.
File
-
core/
lib/ Drupal/ Core/ Field/ Annotation/ FieldType.php, line 17
Namespace
Drupal\Core\Field\AnnotationView source
class FieldType extends DataType {
/**
* The plugin ID.
*
* @var string
*/
public $id;
/**
* The name of the module providing the field type plugin.
*
* @var string
*/
public $module;
/**
* The human-readable name of the field type.
*
* @var \Drupal\Core\Annotation\Translation
*
* @ingroup plugin_translatable
*/
public $label;
/**
* A short human readable description for the field type.
*
* @var \Drupal\Core\Annotation\Translation
*
* @ingroup plugin_translatable
*/
public $description;
/**
* The category under which the field type should be listed in the UI.
*
* @var \Drupal\Core\Annotation\Translation
*
* @ingroup plugin_translatable
*/
public $category = '';
/**
* The weight of the field type.
*
* @var int
*/
public $weight = 0;
/**
* The plugin ID of the default widget for this field type.
*
* This widget must be available whenever the field type is available (i.e.
* provided by the field type module, or by a module the field type module
* depends on).
*
* @var string
*/
// phpcs:ignore Drupal.NamingConventions.ValidVariableName.LowerCamelName
public $default_widget;
/**
* The plugin ID of the default formatter for this field type.
*
* This formatter must be available whenever the field type is available (i.e.
* provided by the field type module, or by a module the field type module
* depends on).
*
* @var string
*/
// phpcs:ignore Drupal.NamingConventions.ValidVariableName.LowerCamelName
public $default_formatter;
/**
* A boolean stating that fields of this type cannot be created through the UI.
*
* @var bool
*/
// phpcs:ignore Drupal.NamingConventions.ValidVariableName.LowerCamelName
public $no_ui = FALSE;
/**
* {@inheritdoc}
*/
// phpcs:ignore Drupal.NamingConventions.ValidVariableName.LowerCamelName
public $list_class;
/**
* An integer defining a fixed cardinality for this field type.
*
* If this value is not set, cardinality can be configured in the field UI.
*
* @var int|null
*/
public $cardinality;
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
DataType::$constraints | public | property | An array of validation constraints for this type. | ||
DataType::$definition_class | public | property | The definition class to use for defining data of this type. | ||
DataType::$list_definition_class | public | property | The definition class to use for defining a list of items of this type. | ||
DataType::$unwrap_for_canonical_representation | public | property | Whether the typed object wraps the canonical representation of the data. | ||
FieldType::$cardinality | public | property | An integer defining a fixed cardinality for this field type. | ||
FieldType::$category | public | property | The category under which the field type should be listed in the UI. | ||
FieldType::$default_formatter | public | property | |||
FieldType::$default_widget | public | property | |||
FieldType::$description | public | property | A short human readable description for the field type. | Overrides DataType::$description | |
FieldType::$id | public | property | The plugin ID. | Overrides DataType::$id | |
FieldType::$label | public | property | The human-readable name of the field type. | Overrides DataType::$label | |
FieldType::$list_class | public | property | The typed data class used for wrapping multiple data items of the type. | Overrides DataType::$list_class | |
FieldType::$module | public | property | The name of the module providing the field type plugin. | ||
FieldType::$no_ui | public | property | |||
FieldType::$weight | public | property | The weight of the field type. | ||
Plugin::$definition | protected | property | The plugin definition read from the class annotation. | 1 | |
Plugin::get | public | function | Gets the value of an annotation. | Overrides AnnotationInterface::get | 6 |
Plugin::getClass | public | function | Gets the class of the annotated class. | Overrides AnnotationInterface::getClass | 1 |
Plugin::getId | public | function | Gets the unique ID for this annotated class. | Overrides AnnotationInterface::getId | |
Plugin::getProvider | public | function | Gets the name of the provider of the annotated class. | Overrides AnnotationInterface::getProvider | 1 |
Plugin::parse | protected | function | Parses an annotation into its definition. | ||
Plugin::setClass | public | function | Sets the class of the annotated class. | Overrides AnnotationInterface::setClass | 1 |
Plugin::setProvider | public | function | Sets the name of the provider of the annotated class. | Overrides AnnotationInterface::setProvider | |
Plugin::__construct | public | function | Constructs a Plugin object. | 3 |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.