PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, May 12, 2022

[FIXED] How to decorate entity definition in shopware 6

 May 12, 2022     shopware, shopware6, symfony, symfony5     No comments   

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.

Definition class to change

my decorate class class with

change length string field

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)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing