public static function DefaultFieldHandler::supports in CMS Content Sync 8
Same name and namespace in other branches
- 2.1.x src/Plugin/cms_content_sync/field_handler/DefaultFieldHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler\DefaultFieldHandler::supports()
- 2.0.x src/Plugin/cms_content_sync/field_handler/DefaultFieldHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler\DefaultFieldHandler::supports()
Check if this handler supports the given field instance.
Parameters
string $entity_type:
string $bundle:
string $field_name:
Return value
bool
Overrides FieldHandlerInterface::supports
File
- src/
Plugin/ cms_content_sync/ field_handler/ DefaultFieldHandler.php, line 22
Class
- DefaultFieldHandler
- Providing a minimalistic implementation for any field type.
Namespace
Drupal\cms_content_sync\Plugin\cms_content_sync\field_handlerCode
public static function supports($entity_type, $bundle, $field_name, FieldDefinitionInterface $field) {
$core_field_types = [
'boolean',
'changed',
'comment',
'created',
'daterange',
'datetime',
'decimal',
'email',
'float',
'iframe',
'integer',
'language',
'list_float',
'list_integer',
'list_string',
'map',
'range_decimal',
'range_float',
'range_integer',
'string',
'string_long',
'telephone',
'text',
'text_long',
'text_with_summary',
'timestamp',
'uri',
'uuid',
];
$contrib_field_types = [
'add_to_calendar_field',
'address',
'address_country',
'address_zone',
'block_field',
'color_field_type',
'easychart',
'geolocation',
'heading',
'key_value',
'key_value_long',
'metatag',
'social_media',
'soundcloud',
'tablefield',
'video_embed_field',
'viewfield',
'yearonly',
'yoast_seo',
'weight',
];
$allowed = array_merge($core_field_types, $contrib_field_types);
return false !== in_array($field
->getType(), $allowed) && ('menu_link_content' != $entity_type || 'parent' != $field_name);
}