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

[ResourceBundle] allow easier custom resources #1776

Conversation

dpfaffenbauer
Copy link
Member

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

Allows you to define custom resources without the need of a DI Extension like:

Pimcore Models

core_shop_resource:
    pimcore:
        app.test:
            path:
                test: test
            classes:
                model: Pimcore\Model\DataObject\Test
                interface: App\Model\TestInterface

Doctrine Entities

core_shop_resource:
    resource:
        app.doctrine_test:
            classes:
                model: App\Entity\DoctrineTest
                interface: App\Model\DoctrineTestInterface
                repository: CoreShop\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository

You than have access to services like factory or repository like:

$container->get('app.repository.test');
$container->get('app.repository.doctrine_test');

$container->get('app.factory.test');
$container->get('app.factory.doctrine_test');

@dpfaffenbauer dpfaffenbauer added this to the 3.0.0 milestone Nov 9, 2021
@dpfaffenbauer dpfaffenbauer requested a review from a team November 9, 2021 16:11
@dpfaffenbauer dpfaffenbauer self-assigned this Nov 9, 2021
@dpfaffenbauer dpfaffenbauer merged commit 22a62b2 into coreshop:master Nov 9, 2021
@dpfaffenbauer dpfaffenbauer deleted the features/eaiser-custom-resources branch November 9, 2021 20:28
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.

1 participant