Query if an entity exists based on various properties and convert to its entity id.
Create a base class that lookups entities and creates a stub if it doesn't exist. Add an ignore_case config option. Because for files and terms and even nodes, we might want to care about that.
- The property configuration option should be an array.
- Convert this to a base class.
- Inject EntityTypeManagerInterface instead of QueryFactory. This way we can also use the entity manager to create stubs. See as an example.
- Add an ignore_case config option.
- If not set, 'entity_type' config option should be set in implementation classes. So accomodate that in the code.
Original summary by @sime
I have this process plugin running as part of a migration. I'm wondering whether to put it in a new module, but checking first if you want something like this in migrate_plus. https://gist.github.com/simesy/755897d43b24e06afeed
Background: we have a taxonomy that is installed as part of an installation profile. When the migration runs, it looks up terms based on term title. Our working process config looks like this:
field_subject: plugin: entity_lookup source: subject entity_type: taxonomy_term property: name