I am trying to design a PHP project's structure. What I am not very sure about is how to implement categories and products relationship. A category has one parent, and can have many children. Product belongs to only one category. Db tables are like this:
products: id product_name category_id
categories id category_name parent_id
I created a class for products, a class for categories. But I do not know what is the best way to relate them in object oriented manner.
Should I have more classes like CategoryManager, if yes what should it look like ?
Anyone has good approach to implement relations in code level, not in db level.
Thanks in advance.