This is a simple migrate process plugin whose only purpose is to negate whatever value is sent over to it.

This is useful for situations where we want to save the opposite of what the source is.

For example, if our source content has a bool value of is_deleted, which roughly translates to Drupal's status (published) field, we actually want the content to be unpublished (0 or FALSE) when the source is marked as deleted (1 or TRUE).

Then all we'd need to do is:

...
process:
  status:
    plugin: negate
    source: is_deleted
...

And it would work as expected.

Supporting organizations: 
Initial development.

Project information

Releases