Mirage
Mirage

Reputation: 31548

How to implement service class in Symfony 2

I am trying to learn the OOP and DI. I am receiving help from FOSUserBundle and coding my own bundle to learn things.

FOS has:

UserManager.php and UserManagerInterface.php.

Now, I want to make UserService.php in the Service folder.

I am confused about whether I can replace UserManager.php with userService.php, or do I need to make a new file?

userService.php extends userManager.php.

I want to keep things modular.

Upvotes: 0

Views: 229

Answers (1)

greg0ire
greg0ire

Reputation: 23255

You are not supposed to edit any file in FOSUserBundle, go with the second solution : inheritance, and use the configuration file to select your userManager instead of the FOS user manager.

Upvotes: 1

Related Questions