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

Doctrine ODM namespace error #42

Open
zvirag opened this issue Jul 2, 2019 · 5 comments
Open

Doctrine ODM namespace error #42

zvirag opened this issue Jul 2, 2019 · 5 comments
Labels
Investigating Require Investigation

Comments

@zvirag
Copy link

zvirag commented Jul 2, 2019

Hi!

I found an issue in latest beta version. I create AuditLog document extends from Model, but didn't work. This is the error message:

The class 'App\\Document\\AuditLog' was not found in the chain configured namespaces App\\Entity, Xiidea\\EasyAuditBundle\\Entity

Thx

@cnizzardini
Copy link

cnizzardini commented Aug 31, 2020

I encounter this in version 1.4 with this configuration:

# Read the documentation: http://xiidea.github.io/EasyAuditBundle/
xiidea_easy_audit:
    #entity_class: App\Document\AuditLog
    default_logger: true
    user_property: null # or username
    audit_log_class: App\Document\AuditLog
    doctrine_objects:
        App\Document\Services: [created, updated, deleted]

We are attempting to track updates to a Doctrine MongoDB (ODM) document.

@ronisaha
Copy link
Member

ronisaha commented Sep 1, 2020

@cnizzardini @zvirag can you provide any example repository with this issue, so I can test

@cnizzardini
Copy link

For this, I have no custom repository, just a Doctrine ODM document for App\Document\Services. I think this library does not look at App\Document. Uses only settings from doctrine.orm and not doctrine_mongodb.

doctrine:
    dbal:
        url: '%env(resolve:DATABASE_URL)%'

        # IMPORTANT: You MUST configure your db driver and server version,
        # either here or in the DATABASE_URL env var (see .env file)
        driver: 'postgresql'
        server_version: '12'
    orm:
        auto_generate_proxy_classes: true
        naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
        auto_mapping: true
        mappings:
            App:
                is_bundle: false
                type: annotation
                dir: '%kernel.project_dir%/src/Entity'
                prefix: 'App\Entity'
                alias: App

versus

doctrine_mongodb:
    auto_generate_proxy_classes: true
    auto_generate_hydrator_classes: true
    connections:
        default:
            server: '%env(resolve:MONGODB_URL)%'
            options: {}
    default_database: '%env(resolve:MONGODB_DB)%'
    document_managers:
        default:
            auto_mapping: true
            # metadata_cache_driver: apcu
            #metadata_cache_driver:
            #    type: redis
            #    class: Doctrine\Common\Cache\RedisCache
            #    host: redisdb
            #    port: 6379
            #    instance_class: Redis
            mappings:
                App:
                    is_bundle: false
                    type: annotation
                    dir: '%kernel.project_dir%/src/Document'
                    prefix: 'App\Document'
                    alias: App

@ronisaha ronisaha added the Investigating Require Investigation label Sep 1, 2020
@ronisaha
Copy link
Member

ronisaha commented Sep 5, 2020

@cnizzardini Could you please share the App\Document\AuditLog class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigating Require Investigation
Projects
None yet
Development

No branches or pull requests

3 participants