2013-06-25 36 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; 

您可以引用這些就像引用表中存在的屬性一樣。

相關問題