0 votes

Hello

Skipper does not allow to specify a mapper superclass and an inheritence in the same time.

Given the following schema, MatchOutcome is an abstract mapped superclass that inherit from Outcome. ThreeWayMatchOutcome inherit from MatchOutcome and is in the discriminator map of Outcome.

I can make it perfectly work editing the yaml mapping my self (https://github.com/dag-io/doctrine-inheritance-playground). Because I can not set the inheritence between ThreeWayMatchOutcome and Outcome and fill up the discriminator map, Skipper will remove the discriminator values that I have set

Schema

in Solved by (350 points)
recategorized by

Can you please share Skipper project file?

You're writing that MatchOutcome inherits from Outcome but on your model there is no such connection.

Also why you're trying to set inheritance between ThreeWayMatchOutcome and Outcome when you wrote that Outcome is already derived by MatchOutcome which is derived by ThreeWayMatchOutcome?

Can you please share Skipper project file?

The skipper project is on Github :
https://github.com/dag-io/doctrine-inheritance-playground/blob/master/DoctrineInheritancePlayground.skipper

You're writing that MatchOutcome inherits from Outcome but on your model there is no such connection.

I set it in the PHP class : https://github.com/dag-io/doctrine-inheritance-playground/blob/master/src/Foo/MatchOutcome.php
Because MatchOutcome is abstract and also a mapped superclass, I think it should not appear in the discriminator map of Outcome so no explicit inheritance should be specify in the yaml mapping ?

Also why you're trying to set inheritance between ThreeWayMatchOutcome and Outcome when you wrote that Outcome is already derived by MatchOutcome which is derived by ThreeWayMatchOutcome?

Because MatchOutcome is a mapped superclass. So ThreeWayMatchOutcome would appear in Outcome discriminator map but MatchOutcome would not appear in that map.

Cheers

Damien

Ok, thanks for explanation. I have to discuss it with my colleague if described use case is valid from Doctrine2 and PHP point of view and how to solve it.

I'm not sure if it's possible to define MappedSuperclass together with inheritance for PHP classes and because of that if it's possible to support such scenario in Skipper.

Hello

I updated the test project : https://github.com/dag-io/doctrine-inheritance-playground

It's perfectly working. You can have a try with testinsert,php and testread.php.

I've been talking with Marco Pivetta from Doctrine2 this week that suggest this approach.

Cheers

Damien

Thanks. I discussed it here with programmers and because they aren't still not sure what and how exactly implement this request I would like to ask you for following samples:

  • two directories with exported schema files where will be the current state and desired state, so our programmers can compare these two directories and try to find a solution (something like currentYml, requiredYml)

  • the same also for XML format and annotations. We have to implement it for all formats, not only YML (something like currentXml, currentAnn and requiredXml, requiredAnn).

  • link to skipper project which was used to generate current* form of project.

  • please try to keep all directories as simple as possible with the lowest number of files. Remove any unnecessary files so they can focus only on this specific problem

This will help our programmers to correctly implement and modified current inner logic. The changes which will be necessary in the application core aren't simple and we would like to be sure that we will modify it correctly.

Thank you for your time and cooperation
Ludek

Closed due lack of new information

Please log in or register to answer this question.