Relation case sensitive

I have defined a relation as follows …




public function getMilestone() {

						

	return $this->hasOne(Milestone::className(), ["id" => "fkIDWithMilestoneID"]);

			

}



When I use "Milestone.name" in a datagrid it states …

Relation names are case sensitive. app\models\Task has a relation named "milestone" instead of "Milestone".

Which is fine because I just use "milestone.name" and it works.

However I am just curious where has got the lowercase "milestone" from?

see this may be help you to understand it.

http://de2.php.net/manual/en/language.oop5.overloading.php#object.get

When using magic get method, where get is not explicitly part of the method call, the first word of the method is lower case. So getMilestone, would become $this->milestone, for example. Not sure if this applies to your use case, but it is likely the cause.

Ok thanks guys.

Whenever I have done magic properties before it was always uppercase so getMilestone would have been $obj->Milestone etc.

But what you are saying seems to be the case, but in the past I always had to call $obj->Milestone to call the magic property, very strange.