Welcome Guest, Not a member yet? Register   Sign In
Model Design Question
#1
Question 

Hello guys,

I have a question regarding the design of the application and/or database tables.

First, I have an (kind of) "abstract" class called AbstractClass where I define some variables and also a corresponding database table (having columns for the variables).

Here comes the problem: If I then extend a SubClass and add some "other child" variables how can I load the child class from the database having also the variables of the parent class? As far as I tried it is not possible to load datas from a database VIEW or am I wrong? 

My current approach is to connect to the database table of the child and "inner join" the parent table. But only the child variables are loaded into the child class object where as the "var_dump" of the database request gives me all columns of the JOIN.

Is there a mistake in my thought regarding the design or is this kind of situation not yet implemented? An similiar example is to have a variable as a custom class which needs to be loaded seperately as CI does not recognize it...

I can provide example code if the question is unclear or needs clarification.
Reply


Messages In This Thread
Model Design Question - by IVIike - 12-11-2019, 06:16 AM
RE: Model Design Question - by vincent78 - 12-11-2019, 11:37 AM
RE: Model Design Question - by IVIike - 12-13-2019, 03:06 AM
RE: Model Design Question - by MGatner - 12-13-2019, 03:59 PM
RE: Model Design Question - by vincent78 - 12-13-2019, 04:47 PM
RE: Model Design Question - by MGatner - 12-14-2019, 05:34 AM
RE: Model Design Question - by IVIike - 12-16-2019, 12:40 AM
RE: Model Design Question - by MGatner - 12-20-2019, 07:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB