Welcome Guest, Not a member yet? Register   Sign In
models question
#1

[eluser]dadamssg[/eluser]
This is probably a dumb question but whatever. Whenever you load a model in your controller, are all the functions you've written to query your db being executed behind the scenes? or are JUST the ones you reference in your controller code being executed.
#2

[eluser]Arministrator[/eluser]
[quote author="dadamssg" date="1306808320"]This is probably a dumb question but whatever. Whenever you load a model in your controller, are all the functions you've written to query your db being executed behind the scenes? or are JUST the ones you reference in your controller code being executed.[/quote]

You load the model to be able to call it's methods (functions). So only the ones you do call get executed. Loading it just makes all of it's methods accessible.
#3

[eluser]theprodigy[/eluser]
When you load the model, the only function that gets executed is the constructor method (if you wrote one). Other than that, as Arministrator said, they become available to you to call, but won't execute unless you call them explicitly.




Theme © iAndrew 2016 - Forum software by © MyBB