Thank you for your glentle cooperation.
Efectively there was a mistake with the name of the array created in the relations area, I correct it and now it works great.
The case sensibilitiness issue could be created in the model creation process. I’ll add the code created for ISSUE table:
<?php
/**
-
The followings are the available columns in table ‘TBL_ISSUE’:
-
@property double $ID
-
@property string $NAME
-
@property string $DESCRIPTION
-
@property double $PROJECT_ID
-
@property double $TYPE_ID
-
@property double $STATUS_ID
-
@property double $OWNER_ID
-
@property double $REQUESTER_ID
-
@property string $CREATE_TIME
-
@property double $CREATE_USER_ID
-
@property string $UPDATE_TIME
-
@property double $UPDATE_USER_ID
-
-
The followings are the available model relations:
-
@property USER $oWNER
-
@property PROJECT $pROJECT
-
@property USER $rEQUESTER
*/
class ISSUE extends CActiveRecord
{
const TYPE_BUG=0;
const TYPE_FEATURE=1;
const TYPE_TASK=2;
public function getTypeOptions() {
return array( self::TYPE_BUG=>'Bug',
self::TYPE_FEATURE=>'Feature',
self::TYPE_TASK=>'Task', );
}
const TYPE_Not_yet_started=0;
const TYPE_Started=1;
const TYPE_Finished=2;
public function getStatusOptions() {
return array( self::TYPE_Not_yet_started=>'Not Yet Started',
self::TYPE_Started=>'Started',
self::TYPE_Finished=>'Finished', );
}
/**
* Returns the static model of the specified AR class.
* @return ISSUE the static model class
*/
public static function model($className=__CLASS__)
{
return parent::model($className);
}
/**
* @return string the associated database table name
*/
public function tableName()
{
return 'TBL_ISSUE';
}
/**
* @return array validation rules for model attributes.
*/
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('NAME', 'required'),
array('PROJECT_ID, TYPE_ID, STATUS_ID, OWNER_ID, REQUESTER_ID, CREATE_USER_ID, UPDATE_USER_ID', 'numerical'),
array('NAME', 'length', 'max'=>256),
array('DESCRIPTION', 'length', 'max'=>2000),
array('CREATE_TIME, UPDATE_TIME', 'safe'),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('ID, NAME, DESCRIPTION, PROJECT_ID, TYPE_ID, STATUS_ID, OWNER_ID, REQUESTER_ID, CREATE_TIME, CREATE_USER_ID, UPDATE_TIME, UPDATE_USER_ID', 'safe', 'on'=>'search'),
);
}
/**
* @return array relational rules.
*/
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'oWNER' => array(self::BELONGS_TO, 'USER', 'OWNER_ID'),
'pROJECT' => array(self::BELONGS_TO, 'PROJECT', 'PROJECT_ID'),
'rEQUESTER' => array(self::BELONGS_TO, 'USER', 'REQUESTER_ID'),
);
}
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array(
'ID' => 'ID',
'NAME' => 'Name',
'DESCRIPTION' => 'Description',
'PROJECT_ID' => 'Project',
'TYPE_ID' => 'Type',
'STATUS_ID' => 'Status',
'OWNER_ID' => 'Owner',
'REQUESTER_ID' => 'Requester',
'CREATE_TIME' => 'Create Time',
'CREATE_USER_ID' => 'Create User',
'UPDATE_TIME' => 'Update Time',
'UPDATE_USER_ID' => 'Update User',
);
}
/**
* Retrieves a list of models based on the current search/filter conditions.
* @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
*/
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('ID',$this->ID);
$criteria->compare('NAME',$this->NAME,true);
$criteria->compare('DESCRIPTION',$this->DESCRIPTION,true);
$criteria->compare('PROJECT_ID',$this->PROJECT_ID);
$criteria->compare('TYPE_ID',$this->TYPE_ID);
$criteria->compare('STATUS_ID',$this->STATUS_ID);
$criteria->compare('OWNER_ID',$this->OWNER_ID);
$criteria->compare('REQUESTER_ID',$this->REQUESTER_ID);
$criteria->compare('CREATE_TIME',$this->CREATE_TIME,true);
$criteria->compare('CREATE_USER_ID',$this->CREATE_USER_ID);
$criteria->compare('UPDATE_TIME',$this->UPDATE_TIME,true);
$criteria->compare('UPDATE_USER_ID',$this->UPDATE_USER_ID);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
}