Issue
I would like to decorate entity definition in plugin shopware 6 to add some modifications. I wolud like to change length string field from standard 255 to 4000.
my decorate class class with
my config service
<service id="MyPlugin\Core\Content\Entities\AttributeTranslationDefinitionDecorator"
decorates="TestPlugin\Entities\Attribute\Translation\AttributeTranslationDefinition" public="false">
<argument type="service" id="MyPlugin\Core\Content\Entities\AttributeTranslationDefinitionDecorator.inner" />
</service>
but this not work. I have tried all the ways with pages https://developer.shopware.com/docs/guides/plugins/plugins/plugin-fundamentals/adjusting-service or https://symfony.com/doc/current/service_container/service_decoration.html
Is it possible to change entity definition in other plugins?
Solution
Decorating entity definitions is not possible, you can't simply change the existing field definitions of the core entities. Instead you can add an EntityExtension
if you want to add more fields to an existing entity. Please refer to the official docs.
Answered By - j_elfering Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.