Setting up a repository pattern in MVC
问题 I'm trying to figure out how the Repository pattern works and how it can be implemented in a custom MVC pattern. As far as i understand it, the Repository is a layer which simply returns data from an entity class or saves the entity class to a persistent layer. Now i currently see it like this: A request comes in into my controller to create a user. Just a username and password. My controller will do something like this: function CreateAction ( ) { $userRepo = new userRepository ( ); $user =