I have created a custom field and I want to load the value dynamically in another way in relation to the specific node entity to which the value belongs.
I understand that to get the value I have to use / know the field name like this
$ entity-> get (& # 39; field_name & # 39;) -> getValue ();
What I want to do is set the field name through the content settings with only the node type and the field name as defined in the FieldItem plug-in.
$ field_definitions = Drupal :: service (& # 39; entity_field.manager & # 39;) -> getFieldStorageDefinitions (& # 39; node & # 39;);
When I rollover $ field_definitions I can see the entire array of fields with all the details but I can not get my node.field_name in relation to the fieldItem name defined in the specific field snap-in, in my case field_custom_example
/ ** * Implementation of field type complement & # 39; field_custom_example & # 39 ;. * * @ Field type ( * id = "field_custom_example", * label = @Translation ("Custom example"), * description = @Translation ("Store data for the custom example field"), * default_widget = "custom_example_widget", * default_formatter = "custome_example_formatter" *) * /
That's where I'm stuck.