$criteria->with pointing to table from another database not working


how come when I use

$criteria->with = 'basicData' and the model BasicData is in another database, that the CActiveDataProvider doesn't work?

I get

CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'PersonnelTracker.BasicData' doesn't exist. The SQL statement executed was: SELECT COUNT(DISTINCT `t`.`id`) FROM `Vehicle` `t` LEFT OUTER JOIN `BasicData` `basicData` ON (`t`.`assignedToEmployee`=`basicData`.`id`) 

It should be ‘LEFT OUTER JOIN People.BasicData’.

I would expect Yii to find that out based on the database connection of the model.

Can somebody help me please?

I have never tried cross database queries with Yii, but you can try prepend the database name in front "People.BasicData";

You mean prepend it to the method tableName() or where else? I can’t do that with the with property of $criteria.