you need a custom search function, like:
public function searchCandidates() {
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria = new CDbCriteria;
$criteria->with = array('candidate_relation');//this is a relation; you can pute here, relation_a.relation_b.relation_c
$criteria->compare('id', $this->id);
$criteria->compare('email', $this->email, true);
$criteria->compare('password', $this->password);
$criteria->compare('created', $this->created);
$criteria->compare('lastmodified', $this->lastmodified);
$criteria->compare('confirmed', $this->confirmed);
$criteria->compare('is_candidate', 1);
$criteria->compare('username', $this->username, true);
$criteria->compare('candidate_relation.first_name', $this->full_name, true);//and another relation here ...
$criteria->compare('candidate_relation.last_name', $this->full_name, true, 'OR');
return new CActiveDataProvider($this, array(
'criteria' => $criteria,
));
}
where full_name
is a custom property for the model: public $full_name;