maker-bundle icon indicating copy to clipboard operation
maker-bundle copied to clipboard

The maker generate my repositories in wrong folder with non standard project structure

Open bechir opened this issue 4 years ago • 3 comments

In my directories structure is something like this:

  • My entities are located in src/Infrastructure/Doctrine/Entity
  • Repositories in src/Infrastructure/Doctrine/Repository

My config:

doctrine:
    orm:
        auto_generate_proxy_classes: true
        naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
        auto_mapping: true
        mappings:
            VipGetzner:
                is_bundle: false
                type: annotation
                dir: '%kernel.project_dir%/src/Infrastructure/Doctrine/Entity/'
                prefix: 'VipGetzner\Infrastructure\Doctrine\Entity'
                alias: VipGetzner

with php bin/console make:entity \\VipGetzner\\Infrastructure\\Doctrine\\Entity\\Foo

I have my entity generated correctly. but the generated repository is inside src/Repository/Infrastructure/Doctrine/Entity!

The createClassNameDetails() inside the EntityClassGenerator class use always "Repository\\" as namespace prefix.

bechir avatar Dec 15 '20 00:12 bechir

@bechir i know your problem, i write a wrapper to resolve that try twc/makerBundle

thewalkingcoder avatar Jan 16 '21 12:01 thewalkingcoder

is there any progress?

cesurapp avatar May 07 '23 16:05 cesurapp

I also have a similar problem. Have you found a solution since ?

Update: I solved the problem on my side via the maker config. see here: https://symfony.com/bundles/SymfonyMakerBundle/current/index.html#configuration

mikayilsrt avatar Sep 25 '23 15:09 mikayilsrt