PHP OOP structure problem, simulate multiple inheritance

dopMovegoorry

New Member
I have an e-shop with multiple product types. And i would have thought of the following structure\[code\]Cart_Item-- Cart_Product-- Cart_DownloadOrder_Item extends Cart_Item-- Order_Product-- Order_Download\[/code\]The problem is that i want to have Order_Product extend Order_Item and Cart_Product.This is because it needs method generic to Order_Item ( get price from Order not from product ) but also methods from Cart_Product ( shipping calculations )I know that php doesn't support multiple inheritance, i was wandering what is the cleanest way to emulate this. Right now i have Order_Product extend Cart_Product duplicate code from Order_Item in Order_Product an Order_Download.
 
Back
Top