Relation Tables Error "column Not Found".

[b]I have two tables :

Categories and CategoriesDescriptions

In CategoriesDescription there is a language_id column.

How do I retrieve data for a particular langauge_id ex: language_id =1

The following AR gives as error saying language_id not found.

$model = Categories::find()->with(

        ['CategoriesDescriptions'=> function($query) {$query->andWhere('language_id=1');}]


        )->all()[/b]

I suppose something is wrong with relationship CategoriesDescriptions.

How does it look like?

You are right. This was what was Generated through Gii

public function getCategoriesDescriptions()


{


	return $this->hasMany(Categories::className(), ['categories_id' => 'categories_id']);


}

I had to edit it by CategoriesDescription::className()

Thnx