bpolaszek / webpush-bundle

Symfony Bundle: Send WebPush Notifications to your users.
MIT License
66 stars 40 forks source link

UserSubscriptionManager:getManager() return none Type because $user instance of Proxies\__CG__\ object #4

Closed AdriwanKenoby closed 6 years ago

AdriwanKenoby commented 6 years ago

The method return nothing because the variable passed could be instance of Proxies__CG__\ object.

AdriwanKenoby commented 6 years ago

I realize this code depend on the ORM Doctrine and you want this bundle to be ORM agnostic

bpolaszek commented 6 years ago

Yep indeed, but since it's a Symfony bundle and since Symfony is shipped with Doctrine by default, I think we should detect Doctrine's Proxy pattern and find the original class (independantly of Doctrine's entity manager, because the doctrine service may not exist in the container). I've already done that in the past, I'll try to improve this.

Anyway, you should not face this problem unless you rely on a Doctrine association. Can I have a sample of your code where you encounter it?

bpolaszek commented 6 years ago

I've done a small fix. Can you try it with dev-master?