Propel
Propel copied to clipboard
"Call to undefined method..." error, in generated base class when use more than two foreign keys
I have this in my "schema.xml" :
<table name="user_role_company" isCrossRef="true">
<column name="user_id" type="INTEGER" primaryKey="true"/>
<column name="role_id" type="INTEGER" primaryKey="true"/>
<column name="company_id" type="INTEGER" primaryKey="true"/>
<foreign-key foreignTable="user" phpName="Urc_User" onDelete="CASCADE">
<reference local="user_id" foreign="id"/>
</foreign-key>
<foreign-key foreignTable="role" phpName="Urc_Role" onDelete="CASCADE">
<reference local="role_id" foreign="id"/>
</foreign-key>
<foreign-key foreignTable="company" phpName="Urc_Company" onDelete="CASCADE">
<reference local="company_id" foreign="id"/>
</foreign-key>
</table>
and Propel generated, in "User.php" base class "User" with this method :
public function getUrc_Roles(ChildCompany $urc_Company = null, Criteria $criteria = null, ConnectionInterface $con = null)
{
return $this->createUrc_RolesQuery($urc_Company, $criteria)->find($con);
}
but method "createUrc_RolesQuery" does not exist in "User.php", and when I call this method, get : "Call to undefined method: createUrc_RolesQuery" error message.
Please, help.
Can you please try to not use underscore in phpName="" attributes?
marcj, thanks for you response.
No results. After changing the value of "phpName" attribute, the problem persists.