Hi Guys - I am having below relationship in my Model:
'userAverageTime' => array(self::HAS_ONE, 'UserStatistics', 'user_id','condition'=>"userAverageTime.key='AVERAGE_TIME'")
It is working perfectly fine if we are having result for a particular user in “UserStatistics” table. But if we don’t have any result in userStatistics table for any user than no result for that user is being shown. I just want an option to show results with blank userStatistics object or without userStatistics object. But it is making an INNER JOIN for userStatistics object. I have tried below options also:
Below options are not working for me:
'userAverageTime' => array(self::HAS_ONE, 'UserStatistics', 'user_id','condition'=>"userAverageTime.key='AVERAGE_TIME'",'joinType'=>'LEFT OUTER JOIN'),
'userAverageTime' => array(self::HAS_MANY, 'UserStatistics', 'user_id','condition'=>"userAverageTime.key='AVERAGE_TIME'"),
'userAverageTime' => array(self::HAS_MANY, 'UserStatistics', 'user_id','condition'=>"userAverageTime.key='AVERAGE_TIME'",'joinType'=>'LEFT OUTER JOIN'),
Can anyone suggest something?
Thanks,
Ravi Verma