php - Creating One-To-Many mapping where Many can be different object types -


I am looking for the feasibility of using a doctorate to recover an existing database.

I have three tables, one stockwork, sales order, work order . Type and not type in the StockRequest field. Used to decide if it is related to the sales order or the workload, and type no is the key to salesorder / work order .

What is the recommended method of maintaining this relationship?

Reading the theory reading, there is a mention of a repository class, which I can use only to get conditional based on the type of maintaining a stockroom entity only.

The other possibility will be the subclass of the StockRequest class so that I have SalesOrderStockRequests and WorkOrderStockRequests

I will make it with heritage and relationship, example:

  The abstract class abotorder (generic field) class cells order abber order {} extends the class work order. Eber order {}   

then class stokeruest {relationship pointing to abstraction}

and when you Get order () {$ $ - order; } Examples of theory u are either sales order or work order

Comments