Changes from Transform API v1 to v2
Transform API v2 has fully rewritten the way entities are transformed. Just like view modes are handled by an EntityViewBuilder, transform modes are now transformed using a EntityTransformBuilder and entity types can define their own if they want.
This means that FieldTransforms are no longer used as the EntityTransformBuilder uses the FieldTransform plugins directly. Transform alters on fields should still work exactly like before, but transform alters on entities will now include field transforms directly instead of including FieldTransform objects.
Transform alters on entities now also include the entity as #{entity_type} just like entity theme templates. It's also still delivered in #entity, but this property is now deprecated.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.