Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Yii Applying default value to models

I am developing a web application for football management. There are two web admin based on the season say for example: spring and non-spring . Both are having separate databases . Now I have a requirement which is to merge both web admin into one so there will be a single web admin and a single db.I am planning to add an additional field to all the table in the database this way I can split the season to spring and non-spring. But I need to add a where condition to all the queries in every models . Is there any way we can avoid this and set a default value and to affects all the queries . For example if I set the season as spring then all the data should come based on the spring season. Is there a place I can set the value ? I am using Yii 1 . Sorry for my bad English.

EDIT:

If I set any where in model/Controller

 $this->season = 'spring';

Then only the data from spring season should come.

Comments