Open donholgo opened 1 year ago
When generating classes for a schema with more than two foreign keys, not all methods are created.
This can be reproduced with the example from the "More than two foreign keys" section in the documentation: After creating the example schema
<database name="demo" defaultIdMethod="native"> <table name="user"> <column name="id" type="integer" primaryKey="true"/> </table> <table name="group"> <column name="id" type="integer" primaryKey="true"/> </table> <table name="type"> <column name="id" type="integer" primaryKey="true"/> </table> <table name="user_group" isCrossRef="true"> <column name="user_id" type="integer" primaryKey="true"/> <column name="group_id" type="integer" primaryKey="true"/> <column name="type_id" type="integer" primaryKey="true"/> <foreign-key foreignTable="user"> <reference local="user_id" foreign="id"/> </foreign-key> <foreign-key foreignTable="group"> <reference local="group_id" foreign="id"/> </foreign-key> <foreign-key foreignTable="type"> <reference local="type_id" foreign="id"/> </foreign-key> </table> </database>
and running propel model:build, the generated Base/User.php contains calls
propel model:build
Base/User.php
return $this->createGroupsQuery($type, $criteria)->find($con);
(in getGroups and countGroups), but there is no method createGroupsQuery defined. Same for createUsersQuery in Base/Group.php and Base/Type.php.
getGroups
countGroups
createGroupsQuery
createUsersQuery
Base/Group.php
Base/Type.php
This seems to have been a problem in Propel 1 already: https://github.com/propelorm/Propel/issues/1019
When generating classes for a schema with more than two foreign keys, not all methods are created.
This can be reproduced with the example from the "More than two foreign keys" section in the documentation: After creating the example schema
and running
propel model:build
, the generatedBase/User.php
contains calls(in
getGroups
andcountGroups
), but there is no methodcreateGroupsQuery
defined. Same forcreateUsersQuery
inBase/Group.php
andBase/Type.php
.