pomm-project / pomm-bundle

Pomm2 bundle for Symfony
81 stars 31 forks source link

An alias can not reference itself, got a circular reference on ProductModel #96

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi, I have a problem since I put version 2.4. My models declarent as Symfony services like that :

    App\Infrastructure\Model\ProductModel:
        public: true
        tags: [pomm.model]

I have an error when used my model : An alias can not reference itself, got a circular reference on ProductModel

I tried to delete tags: [pomm.model] but a new error has occured :

ProductModel is not registered against the session

sanpii commented 6 years ago

It seems there is a bug when the name of the service is the class name.

You can write:

    product_model:
        class: App\Infrastructure\Model\ProductModel
        public: true
        tags: [pomm.model]
sanpii commented 6 years ago

Fixed in 2.4.1, thank you.

ghost commented 6 years ago

Thanks :+1: