Open phtmgt opened 6 years ago
You will only be able to access services through "$this->get()" if your SitemapBlogPostsSubscriber
class inherits from ContainerAwareInterface. Instead of doing that, you could inject service ekino.wordpress.manager.post
into your class.
Trying to do this in Symfony 3.3 we always get "Attempted to call an undefined method named "get" of class "AppBundle\EventSubscriber\SitemapBlogPostsSubscriber""
The call in question is this: $postManager = $this->get('ekino.wordpress.manager.post');
We tried defining 'ekino.wordpress.manager.post' as an attribute for the service in services.yml, but no luck.
Any suggestions are highly appreciated.
Thanks.