Answer the question
In order to leave comments, you need to log in
How to properly build a class to work with users in php?
I'm working on the engine. You need to write a class to work with users. What should be in such a class? What methods? What should this class be able to do?
Answer the question
In order to leave comments, you need to log in
Depends on that pattern on which you implement operation with basis.
What framework do you use?
In general, you need 2 controllers: authorization / registration / password recovery and profile.
As for the model, it is 1-4 classes.
If you don't know what a class should implement, maybe you don't need it?
Entity class (just sets/returns properties) and handler class (authorization, registration, remember me functionality). You can also class-mapper (delete, add, select from the database), if not, then use activeRecord and shift these functions to the entity.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question