I am running into a small problem when trying to get a simple relational AR query to work. The error I am getting is:
'The relation "{relation}" in active record class "{class}" is specified with an invalid foreign key "{key}". The foreign key does not point to either joining table.'
I am curious if the following method should compare case-insensitive $table->name to $name?:
private function tableMatch($schema,$table,$name)
{
if(strpos($name,'.')===false)
return $table->name===$name;
else
{
$table2=$schema->getTable($name);
return $table->rawName===$table2->rawName;
}
}
In my case, it seems to be returning false based on comparing Tablename===tablename
(if this is not the issue, I will post more about the specifics of my tables, relations, etc…)