S
S
snovazabilparol2017-10-17 18:54:10
Yii
snovazabilparol, 2017-10-17 18:54:10

How to work with the database in Yii2 without ActiveRecords?

Welcome all.
The question was actually in the title. I don’t use ActiveRecords because of low performance (according to data from Runet blogs) and other logic for using models. In my opinion, the main logic of the application should be concentrated in models, but the model should not be rigidly tied to a table in the database. Since I got acquainted with the framework only recently, I don’t know much yet, but I feel a certain overload of possibilities or something.
Right now I'm using the construct for Select `s, but the construct for doing an Update(new Query())Yii::$app->db->createCommand()does not work correctly. Perhaps there is a helper class for working with the database in Yii2 in the "usual" way. Of course, I’m even a little ashamed that I don’t know such simple things, but everyone once met with this for the first time.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-10-17
@webinar

does not work correctly

How is that? What exactly do you think is not correct?
Do you do that? www.yiiframework.com/doc-2.0/guide-db-dao.html#non...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question