I need to create this database schema in Symfony Entities:
ClassA:
- ID
- name
- ... some other attributes only for class A
ClassB:
- ID
- name
- ... some other attributes only for class B
ClassC:
- ID
- name
- ... some other attributes only for class C
Course:
- ID
- name
- of type
- class_id
- class_type [A, B, C]
- ...
I need to create a relationship between the course Entity (using class_id) with other objects (ClassA, ClassB, ClassC) (using the identifier) and using class_type (A, B, C).
A course is not a class, and a class is not a course. There is no inheritance. In my project, I use this concept (id and type to display different objects). So I need to solve this problem with a simple example like this
I thought about using @ORM \ DiscriminationMap here:
abstract class Course
{
}
class ClassA extends Course
{
}
class ClassB extends Course
{
}
class ClassC extends Course
{
}
Or something like that.
Course ClassA, ClassB, ClassC, "extends" .
. , , - .