Q:

Yii DAO implementation.

If I only use DAO to save data in Yii , can I use the rules function of the model ? Of course I would not be declaring AR instance . Can I still validate using rules function ?

A:

Create a new model class extending CModel.
Create the rules method as normal.
You can then do
$model = new MyModel();
$model->myAttribute = 'value';

if ($model->validate())
{
    Yii::app()->db->createCommand()
        ->update(
            'MyTable',
            array('myAttribute' => $model->myAttribute),
            'key=:id',
            array(':id' => 'key')
        );
}

