0

I have one abstract class for three different products, in this abstract class they share, for example, $name, $sku, $size, they also share one method called "setAttributes" when creating the extended classes for each type of product lets say Chairs Consoles Appliances, setAttributtes change depending on the class that its being created that means that "Chairs" can have attributes like material and size Consoles may have brand and generation and Appliances type so at the end it creates different objects with some properties in common and some different properties

What is the best way to store this in a data base?

First I made 3 different tables depending on the product that its created but since there is no relation between all they when I tried to get the data to display it in the front end it is simply a mess, and it will be a mess when I try to delete them

So I want to store them all in only one table but how to do this when they not share the same columns?

edmblue
  • 1
  • 1
  • 2
  • 1
    One thing to also consider is whether you really need a dedicated class per product, or maybe just a single "Product" class with attributes. – Chris Haas Feb 03 '23 at 18:04

0 Answers0