Yahoo is stored in the database as a integer, but I don’t want to search on integers, but on text. So if I search for yah, I get all hosts that contain yah in it!
I think the answer is in this part of code, this is the Domain model:
public function search()
{
// @todo Please modify the following code to remove attributes that should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('id',$this->id);
$criteria->compare('url',$this->url,true);
$criteria->compare('primary_url_id',$this->primary_url_id, true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
$criteria->compare('domain.url',$this->primary_url_id, true);
// 'together' will force a left join, that's extra cost for searching in relations
$criteria->with = array('domain'=>array('together'=>true));
Just make sure that the ‘primary_url_id’ attribute is not limited to integers in the ‘search’ scenario. I know this looks strange but is it’s valid anyway.