Welcome Guest, Not a member yet? Register   Sign In
Why call parent constructor when creating a model?
#8

[eluser]Aken[/eluser]
Gotcha.

Looking at the code for CI_Model again, I was misleading. The constructor actually only calls the log_message() function for debugging purposes. The magic function __get() is what handles the automatic loading of CI resources.

So, you actually don't need to call the parent constructor at all if you have no need for the debug message. Which, in my opinion, is actually really vague anyway, since it just says "Model Class Initialized" - doesn't actually name the model at all.


Messages In This Thread
Why call parent constructor when creating a model? - by El Forum - 01-25-2012, 07:26 AM
Why call parent constructor when creating a model? - by El Forum - 01-25-2012, 07:51 AM
Why call parent constructor when creating a model? - by El Forum - 01-25-2012, 07:57 AM
Why call parent constructor when creating a model? - by El Forum - 01-25-2012, 08:01 AM
Why call parent constructor when creating a model? - by El Forum - 01-26-2012, 12:34 AM
Why call parent constructor when creating a model? - by El Forum - 01-26-2012, 03:09 AM
Why call parent constructor when creating a model? - by El Forum - 01-26-2012, 03:27 AM
Why call parent constructor when creating a model? - by El Forum - 01-26-2012, 11:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB