Database Table inheritance in Doctrine
Have you came across a situation when you need to apply Object Oriented Inheritance principle in database design? Did you have two tables sharing some fields and you wanted to connect them together without having to run queries or parallel insertion? Search no more as Doctrine supports this using Class Inheritance with discriminatorMap.
At the end of this post, you’ll learn how to create a product table (super class) and 3 different product category tables (furniture, food, online downloadable items) that inherent product table so when you insert a new furniture item, it will save same id, price to product table as well.