2013-06-25 113 views

回答

2

是的,这是可能的。在您的模型中

<?php 

/** 
* This is the model class for table "{{table}}". 
* 
* The followings are the available columns in table '{{table}}': 
* @property integer $id 
....... 
*/ 
class Table extends CActiveRecord 
{ 

部分您可以为您的类定义自定义属性。像这样:

class Table extends CActiveRecord 
{ 
    public $aPublicAttribute; 
    private $_aPivateAttribute; 

您可以引用这些就像引用表中存在的属性一样。

相关问题