Skip to content

Instantly share code, notes, and snippets.

@Blizzke
Created March 22, 2014 13:38
Show Gist options
  • Save Blizzke/9707266 to your computer and use it in GitHub Desktop.
Save Blizzke/9707266 to your computer and use it in GitHub Desktop.
class ActiveRecord extends CActiveRecord
{
public static function model($sClassName = NULL)
{
if ($sClassName == NULL)
$sClassName = get_called_class();
$oModel = parent::model($sClassName);
$oModel->resetScope();
$oModel->setDbCriteria(new CDbCriteria($oModel->defaultScope()));
return $oModel;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment