I have created a custom field and I wish to load the value dynamically in another form in relation to the specific node entity the value belongs to. I understand that to get the value I have to use/know the field_name like this
$entity->get('field_name')->getValue();
What I want is to get the field_name set via content configurations with only the type of node and the field name as defined in the fieldItem Plugin
$field_definitions = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions('node');
When I dump $field_definitions am able to see all the fields array with all the details but I can't get my node.field_name in relation to the fieldItem name defined in the specific field plugin, in my case field_custom_example
/**
* Plugin implementation of the 'field_custom_example' field type.
*
* @FieldType(
* id = "field_custom_example",
* label = @Translation("Custom Example"),
* description = @Translation("Stores data for Custom Example Field"),
* default_widget = "custom_example_widget",
* default_formatter = "custome_example_formatter"
* )
*/
that's where am stuck.