Hi Ankit Modi,
There is a field as "type" in authitem table.
<?php
class AuthItem extends CActiveRecord
{
public static function model($className=__CLASS__)
{
return parent::model($className);
}
public function tableName()
{
return 'authitem';
}
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('id, name, type, last_modified_user, date_last_modified, enabled', 'required'),
array('type, enabled', 'numerical', 'integerOnly'=>true),
array('name', 'length', 'max'=>64),
array('last_modified_user', 'length', 'max'=>25),
array('description, bizrule, data', 'safe'),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('name, type, description, bizrule, data, last_modified_user, date_last_modified, enabled', '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(
'authassignments' => array(self::HAS_MANY, 'Authassignment', 'itemname'),
'authitemchildren' => array(self::HAS_MANY, 'Authitemchild', 'parent'),
'authitemchildren1' => array(self::HAS_MANY, 'Authitemchild', 'child'),
);
}
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array(
'id' => 'id',
'name' => 'Name',
'type' => 'Type',
'description' => 'Description',
'bizrule' => 'Bizrule',
'data' => 'Data',
'last_modified_user' => 'Last Modified User',
'date_last_modified' => 'Date Last Modified',
'enabled' => 'Enabled',
);
}
/**
* 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.
........
}
Thanks & Regards,
Vidhya