I am confused that in which file i need to create symfony functions.
E,g
I have class User.php and .
Now i have many functions
like
addUser() , editUser(), sleectUserBySubject() , findUserBydate()
Now i don’t know where should i declare these
Entity\User.php
UserController.php
UserRepository.php
Model\User.php
EDIT: Now for what purpose i can use UserManager.php. Still confused which function will come there
Please guide which is the best practice
If the methods are simply used to query the DB for a group of
Userentities, use aUserRepositoryclass (selectUserBySubject()andfindUserByDate()are good candidates for repository methods if they don’t rely on any other classes). If the methods are more complex, and/or deal with business logic, use a service class.Please see my answer regarding the best place for business logic.