helvete / hybrid_mapping_driver

Hybrid mapping driver
GNU General Public License v3.0
2 stars 2 forks source link

Cannot configure this driver using YAML #1

Open DurandA opened 2 years ago

DurandA commented 2 years ago

Hi and thank you for sharing this driver.

I am trying to enable this driver using .yaml configuration files without success.

I tried converting the provided doctrine_config_example.neon to YAML manually:

services:
    doctrineAnnoReader:
        class: Doctrine\Common\Annotations\AnnotationReader
    doctrineAnnoDriver:
        class: Doctrine\ORM\Mapping\Driver\AnnotationDriver
        arguments:
            - '@doctrineAnnoReader'
            - '%kernel.project_dir%/src/Entity'
    doctrineAttrDriver:
        class: Doctrine\ORM\Mapping\Driver\AttributeDriver
        arguments:
            - '%kernel.project_dir%/src/Entity'
    hybridMappingDriver:
        class: Utils\Doctrine\HybridMappingDriver
        arguments:
            - '...'
            - '...'
            - '...'
            - true
    entityManager:
        class:
            Doctrine\ORM\EntityManager
        factory:
            ['Utils\Doctrine\EntityManagerFactory', 'create']
        arguments:
            - '%doctrine%'
            - '@hybridMappingDriver'
            - true

However, this does not seem to load if I put it in config/services.yaml or in config/packages/doctrine.yaml (I created a new services section). How to enable this driver using YAML?

Thank you for your time.

helvete commented 2 years ago

Hello, is there some error message? Or is the configuration just ignored?

My tip would be, that some notation is neon/nette specific and needs to be adapted for your usage.

Are you trying to use it with Symfony?

Please share more details.