joinWith Error

I have a joinWith query

return $this->joinWith('contactusGmapValues')





    public function getContactusGmapValues()


        return $this->hasMany(ContactusValue::className(), ['contactus_name' => 'name'])->where(['gmap'=>1]);


In the debugger it shows the below query to be run :

SELECT `contactus`.* FROM `contactus` LEFT JOIN `contactus_value` ON `contactus`.`name` = `contactus_value`.`contactus_name` WHERE ((`contactus`.`status`=1) AND (`contactus_value`.`status`=1) AND (`contactus_value`.`gmap`=1)) AND (`gmap`=1) ORDER BY `contactus`.`sort_order`

On the Database the above query displays result-set as expected.

But the Yii Resultset from the query returns contactusGmapValues values which are not ‘contactus_value.gmap’=>1 too.

Plz help.

My bad… works fine now… I was calling contactusValues instead of contactusGmapValues