like remove from model or controller. can you give me an example:
like i have the following model for user:
<?php
/**
-
The followings are the available columns in table ‘{{users}}’:
-
@property integer $user_id
-
@property integer $user_type
-
@property string $user_name
-
@property string $firstName
-
@property string $lastName
-
@property string $email
-
@property string $user_registered
-
@property string $lastVisitDate
-
@property boolean $activation
-
@property boolean $block
*/
class Users extends CActiveRecord
{
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return Users 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 '{{users}}';
}
/**
* @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('user_type', 'numerical', 'integerOnly'=>true),
array('user_name, firstName, lastName, email', 'length', 'max'=>50),
array('user_registered, lastVisitDate, activation, block', 'safe'),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('user_id, user_type, user_name, firstName, lastName, email, user_registered, lastVisitDate, activation, block', '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(
);
}
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array(
'user_id' => 'User',
'user_type' => 'User Type',
'user_name' => 'User Name',
'firstName' => 'First Name',
'lastName' => 'Last Name',
'email' => 'Email',
'user_registered' => 'User Registered',
'lastVisitDate' => 'Last Visit Date',
'activation' => 'Activation',
'block' => 'Block',
);
}
/**
* 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('user_id',$this->user_id);
$criteria->compare('user_type',$this->user_type);
$criteria->compare('user_name',$this->user_name,true);
$criteria->compare('firstName',$this->firstName,true);
$criteria->compare('lastName',$this->lastName,true);
$criteria->compare('email',$this->email,true);
$criteria->compare('user_registered',$this->user_registered,true);
$criteria->compare('lastVisitDate',$this->lastVisitDate,true);
$criteria->compare('activation',$this->activation);
$criteria->compare('block',$this->block);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
}
i want to remove
-
@property string $user_registered
-
@property string $lastVisitDate
-
@property boolean $activation
-
@property boolean $block
from the crud functionality. Shall i make change in the model page then generate the crud function. If so then please change this (remove the lines) code so that i can understand and apply afterward.
Thanks