Answer the question
In order to leave comments, you need to log in
How to call the class that has access to the database?
Good evening.
In MVC, this is often done by the model. But what about in the general case? Now I use the Repository for this, and the fact that the database is the repository remains an implementation detail (something tells me that this solution is far-fetched and semantically incorrect). At the same time, Yii has ActiveRecord, which is bound to a table and is called a model by many.
So what is usually a class whose authority is to access the database to get / save certain entities, for example, User? And what is the right thing to do, to bind such classes to an entity or to a table?
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Yii have an ActiveRecord that is bound to a table
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question