Expose a mechanism to set data by property path, analogous to fetchDataByPropertyPath & fetchDataBySubPaths

Created on 19 November 2018, over 5 years ago
Updated 24 June 2024, 4 days ago

Scenario:

* Importing data from a 3rd party data source.
* Mapping defined based on drupal entity definitions, using property paths.
* The Drupal entity (stub) is being created from 3rd party data, does not exist yet, so all field values are null.

Request:

* Provide a method to return appropriately initialized TypedData object which can be used to initalize the field with the new data in order to create the entity.

What I've tried that doesn't work

* $node is a Node entity stub returned from Node::create()
* $typed_data is the return value of $node->getTypedData()
* $property_path is e.g. field_foo.column_bar or field_foo.0.column_bar
Calling fetchDataByPropertyPath() throws InvalidArgumentException or MissingDataException

Maybe this already exists and i'm looking in the wrong place. If you know, please point me to it!
Thanks!

✨ Feature request
Status

Active

Version

2.1

Component

Data fetcher

Created by

πŸ‡ΊπŸ‡ΈUnited States AaronBauman Philadelphia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024