<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * 自动填充修改时间行为
 *
 * @author yzxh24
 */
class UpdateAtBehavior extends CActiveRecordBehavior
{
    public function beforeValidate($on)
    {
        if (!$this->Owner->isNewRecord)
        {
            $this->Owner->updatedate = new CDbExpression('NOW()');
        }

        return true;
    }
}