public function rules() { return array( // all the required fields array('content, created_on_utc', 'required'), // foreign keys array('user_id', 'exist', 'allowEmpty'=>false, 'className'=>'User', 'attributeName'=>'id'), array('deal_id', 'exist', 'allowEmpty'=>false, 'className'=>'Deal', 'attributeName'=>'id'), // the dates array('created_on_utc', 'date', 'allowEmpty'=>false, 'format'=>ZUtil::MYSQL_DATETIME_FORMAT), ); }