I am building a multisite app where all queries are based on the siteId and must have a WHERE siteId = ‘’ clause.
Currently I am setting the site id at params.php
return array(
'siteId' => '23',
'defaultPageSize'=>20,
);
and passing ALL queries like this in the controller :\
'criteria'=>array(
'condition'=>"t.SiteId = '". Yii::app()->params['siteId'] . "'",
'order'=>'SortOrder ASC',
),
and there are over hundred of sql statements…
How do I write the “WHERE siteId = ‘’” built into the underlying models so the footprint is small?