Welcome Guest, Not a member yet? Register   Sign In
Redundant Code
#4

[eluser]insub2[/eluser]
Sorry, I forgot to explain that the userID is set in the model from the session data. It is not sent to the model from the controller.

The validation is in the controller. The second version of the model is making sure there is a userID *in case* the model gets called without having a logged in user. If there isn't a userID set, I'll get a database error. It just seems like it may be a good idea to protect against that (unlikely) scenario.


Messages In This Thread
Redundant Code - by El Forum - 10-16-2009, 05:46 PM
Redundant Code - by El Forum - 10-17-2009, 01:07 AM
Redundant Code - by El Forum - 10-17-2009, 01:27 AM
Redundant Code - by El Forum - 10-17-2009, 09:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB