I'd need some advice concerning Inheritance of Domain Models and Doctrine.
Our Cooperative has two different types of users (and there will be more in the future).
At present we have:
One for natural persons (Member) and
one for enterprises (CorporateMember).
Both have lots of properties in common, so my first idea was:
Write an Interface (MemberInterface),
Write the class AbstactMember, which implements the IF.
Member and CorporateMember extend AbstactMember.
This would have been my preferred solution.
But than I started reading the docs about"single table inheritance" an "class table inheritance".
It seems to be complicated to configure all this, and I really can't see the benefits.
To keep it as simple as possible, and to avoid any difficulties with doctrine, I did the following:
I wrote the IF MemberInterface.
I wrote the Trait MemberTrait, which holds common properties and methods.
Member and CorporateMember implement the MemberInterface an use the MemberTrait.
This is the solution I've implemented so far. It works well.
There is also a MemberService for both Objects. The methods of the MemberService accept the argument MemberInterface.
The big question to the experts in Flow and doctrine:
Which practice is better? Using an Abstact Class or a Trait, or is there anything better.
Do you see problems in the future? This software will be used for decades!
P.S. We don't want to use the party package.