A
A
Andrey Zanovsky2014-04-08 11:53:35
symfony
Andrey Zanovsky, 2014-04-08 11:53:35

Symfony2, how to override class methods from HWIOAuthBundle?

Hello.
You need to override the properties and methods of the HWI\Bundle\OAuthBundle\OAuth\ResourceOwner\VkontakteResourceOwner and HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse classes.
There is a UserBundle bundle, in the AcmeUserBundle.php file I added

public function getParent()
    {
        return 'HWIOAuthBundle';
    }

and created files and their corresponding classes Acme\UserBundle\OAuth\ResourceOwner\VkontakteResourceOwner.php and Acme\UserBundle\OAuth\\Response\PathUserResponse.php, in which he inherited the classes that need to be overridden, and wrote his methods in them. This is how the controllers in the FOSUserBundle are redefined.
But it did not help. All the same, methods from the parent class are executed.
Please tell me how to do what I need.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-04-08
@andrei_z

Write services, register them in a container, configure HWIOAuthBundle to work with your services instead of the default ones... profit. Inappropriately there is no inheritance of bundles, given that it has nothing to do with userBundle.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question