\Drupflare\Anachron\Drupal\Field LegacyFieldTypes

Describes field types, widgets and formatters in the arrays Drupal 7's `field_info_*_types()` gave.

Plugins derived from a Drupal 7 module's hook_field_info() lose their retrofit_field:, retrofit_field_widget: and retrofit_field_formatter: prefix, so a module asks for the type name it declared. Every other plugin keeps its Drupal 11 id.

Summary

Methods
Properties
Constants
__construct
fieldTypes
widgetTypes
formatterTypes
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
plugins
pick
text
strip
types
widgets
formatters
PREFIXES

Constant

PREFIXES

PREFIXES = ['retrofit_field:', 'retrofit_field_widget:', 'retrofit_field_formatter:']

Properties

$types

$types : \Drupal\Core\Field\FieldTypePluginManagerInterface

Type

FieldTypePluginManagerInterface

$widgets

$widgets : \Drupal\Component\Plugin\Discovery\DiscoveryInterface

Type

DiscoveryInterface

$formatters

$formatters : \Drupal\Component\Plugin\Discovery\DiscoveryInterface

Type

DiscoveryInterface

Methods

__construct()

__construct(\Drupal\Core\Field\FieldTypePluginManagerInterface  $types, \Drupal\Component\Plugin\Discovery\DiscoveryInterface  $widgets, \Drupal\Component\Plugin\Discovery\DiscoveryInterface  $formatters) : mixed

Parameters

\Drupal\Core\Field\FieldTypePluginManagerInterface $types
\Drupal\Component\Plugin\Discovery\DiscoveryInterface $widgets
\Drupal\Component\Plugin\Discovery\DiscoveryInterface $formatters

Returns

mixed —

fieldTypes()

fieldTypes(?string  $type = null) : array<string,mixed>

Describes one field type, or every one.

Parameters

?string $type

Returns

array —

widgetTypes()

widgetTypes(?string  $type = null) : array<string,mixed>

Describes one widget type, or every one.

Parameters

?string $type

Returns

array —

formatterTypes()

formatterTypes(?string  $type = null) : array<string,mixed>

Describes one formatter type, or every one.

Parameters

?string $type

Returns

array —

plugins()

plugins(\Drupal\Component\Plugin\Discovery\DiscoveryInterface  $discovery) : array<string,array<string,mixed>>

Parameters

\Drupal\Component\Plugin\Discovery\DiscoveryInterface $discovery

Returns

array> —

pick()

pick(array  $all, ?string  $type) : array<string,mixed>

Parameters

array $all
?string $type

Returns

array —

text()

text(mixed  $value) : string

Core declares some descriptions as a list of sentences.

Parameters

mixed $value

Returns

string —

strip()

strip(string  $id) : string

Parameters

string $id

Returns

string —