A
A
Alexander Vanin2019-08-18 16:57:48
Yii
Alexander Vanin, 2019-08-18 16:57:48

Is it possible to create two (or more) models for the same table in Yii2?

I need to process the same table in different ways depending on the circumstances. For example, if there is already a model that is already widely used in the system, but has a feature - the use of sessions in behavior. However, I need to process the same table and fill it with data in cron, which does not allow the "feature" of this model.
Question: Can I make an additional model to handle this particular case (without using sessions)? If not, how can I bypass these sessions when working in a console application?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Derepko, 2019-08-18
@xEpozZ

https://github.com/yiisoft/yii2/blob/4359f4665b1b1...
Here is an example, as done in the framework.
But this is not very correct from the word at all. If you don't understand why, then you can do it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question