[Question/help] Abstract class / MappedSuperClass #5126
Unanswered
markusgillmeister
asked this question in
Q&A
Replies: 1 comment
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
this is primarily more a question than an issue:
I'm preparing to migrate a legacy api implementation to API Platform. I was happy to see
that symfony serializer supports now (in 4.1) abstract classes (https://symfony.com/blog/new-in-symfony-4-1-serialize-and-deserialize-from-abstract-classes) which seem to solve my problem.
So I set up a project with symfony 4.1(beta2/3) and api platform but I was not successful.
Let me explain the "model": In my project I have items (called ci) which can be from a different type (called product) with different attributes, which are stored in separate tables (not an EAV model, but similar).
Database layout looks like this
The goal is that API platform can return attributes (store in tables like product_client, product_server depending on product_id of ci) of a ci (and do insert/update operations).
I tried around with abstract class ("AbstractProduct") , DiscriminatorMap and MappedSuperClass but I didn't get it working.
Perhaps someone can give me a hint what I'm doing wrong or how should I implement this.
Here is one of my attempts which results in
Ci.php
AbstractProduct.php
ProductClient.php
Does anyone have a hint what's wrong?
Beta Was this translation helpful? Give feedback.
All reactions