public function search()
{
// @todo Please modify the following code to remove attributes that should not be searched.
$criteria=new CDbCriteria;
$criteria->addCondition('id=1');
$criteria->compare('id',$this->id);
$criteria->compare('login',$this->login,true);
$criteria->compare('name',$this->name,true);
$criteria->compare('password',$this->password,true);
$criteria->compare('random_pass',$this->random_pass,true);
$criteria->compare('default_number_of_devices',$this->default_number_of_devices);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
'sort'=>array('defaultOrder'=>'name ASC',)
));
}
I use ID 1
like $criteria->addCondition('id=1')
, it's not automatic just display record with id=1
, how can I get automatic ID from user season login.