New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Inheritance] Issue when mixing concrete and single inheritance in the schema #563

Closed
youssefelbied opened this Issue Jan 16, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@youssefelbied
Contributor

youssefelbied commented Jan 16, 2013

Hi,

I have a schema where a Child table extends a Parent one using concrete inheritance. The Child table is extended itself to different kinds ChildKind1, ChildKind2, etc..., using single inheritance.

The models generation goes well with no errors. However, when dealing with the models in PHP, I got an error standing that the getOMClass method are not compatible between the Parent's peer class and the Child peer one. Indeed, the getOMClass in ParentPeer has no arguments whereas in ChildPeer it has 2 ones.

Thanks.

@willdurand

This comment has been minimized.

Show comment
Hide comment
@willdurand

willdurand Jan 16, 2013

Member

Ah right, I guess there is an issue already.

Member

willdurand commented Jan 16, 2013

Ah right, I guess there is an issue already.

@youssefelbied

This comment has been minimized.

Show comment
Hide comment
@youssefelbied

youssefelbied Feb 2, 2013

Contributor

Hi again,

A workaround is to change the signature of the getOMClass() declarations in PHP5PeerBuilder class to a general form acceptable in all cases: public static function getOMClass(\$row = 0, \$colnum = 0).

There are in fact 4 occurrences of getOMClass declaration in PHP5PeerBuilder file: lines 1308, 1362, 1385 and 1389.

I can PR for this change if your think it has no side effect.

Contributor

youssefelbied commented Feb 2, 2013

Hi again,

A workaround is to change the signature of the getOMClass() declarations in PHP5PeerBuilder class to a general form acceptable in all cases: public static function getOMClass(\$row = 0, \$colnum = 0).

There are in fact 4 occurrences of getOMClass declaration in PHP5PeerBuilder file: lines 1308, 1362, 1385 and 1389.

I can PR for this change if your think it has no side effect.

@willdurand

This comment has been minimized.

Show comment
Hide comment
@willdurand

willdurand Feb 2, 2013

Member

Yes, you can try to write a patch. We'll see if it breaks something.

Member

willdurand commented Feb 2, 2013

Yes, you can try to write a patch. We'll see if it breaks something.

@willdurand willdurand closed this Feb 11, 2013

c33s pushed a commit to c33s/Propel that referenced this issue Feb 5, 2014

Changed the signature of generated "getOMClass()" functions to a more…
… generic form to be compatible with Concrete Inheritance Behaviour (as of: propelorm#563 (comment)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment