Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ClassDefinitionPatchBundle] introduce new Bundle to allow patching Pimcore Class Definitions #2279

Merged
merged 8 commits into from
May 14, 2023

Conversation

dpfaffenbauer
Copy link
Member

@dpfaffenbauer dpfaffenbauer commented May 11, 2023

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no

This feature allows to patch class definitions and preview the patches for Pimcore Class Definitions. Use Case is mainly for other Extensions that need new fields or changes on Class Definitions.

Example:

core_shop_class_definition_patch:
    patches:
        '%coreshop.model.company.pimcore_class_name%':
            fields:
                name2:
                    before: 'addresses'
                    definition:
                        fieldtype: input
                        title: coreshop.company.name2
        '%coreshop.model.customer.pimcore_class_name%':
            fields:
                name2:
                    before: 'firstname'
                    definition:
                        fieldtype: input
                        title: coreshop.company.name2

patch

@dpfaffenbauer dpfaffenbauer added this to the 3.1.0 milestone May 11, 2023
@dpfaffenbauer dpfaffenbauer requested a review from a team May 11, 2023 11:00
@dpfaffenbauer dpfaffenbauer self-assigned this May 11, 2023
@dpfaffenbauer dpfaffenbauer changed the title Features/patcher [ClassDefinitionPatchBundle] introduce new Bundle to allow patching Pimcore Class Definitions May 11, 2023
@dpfaffenbauer dpfaffenbauer marked this pull request as ready for review May 11, 2023 13:11
docs/02_Bundles/ClassDefinitionPatch_Bundle.md Outdated Show resolved Hide resolved

private function makePlusLinesGreen(string $string): string
{
return Strings::replace($string, self::PLUS_START_REGEX, '<fg=green>$1</fg=green>');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you're using the Nette tools here, instead of the Symfony string component?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied that part from somewhere else. I dind't wanna include a package just for this. I can check if Symfony String also solves this. Makes one less dependency.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdreesen works with Symfony String, thanks for the hint 💪

@dpfaffenbauer dpfaffenbauer merged commit 42be1ad into coreshop:master May 14, 2023
@dpfaffenbauer dpfaffenbauer deleted the features/patcher branch May 14, 2023 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants