Welcome Guest, Not a member yet? Register   Sign In
Model concept question
#7

(01-16-2017, 02:00 AM)venkat Wrote:
(01-16-2017, 01:09 AM)meSmashsta Wrote:
(01-16-2017, 12:40 AM)venkat Wrote:
(01-15-2017, 10:40 PM)meSmashsta Wrote:
(01-15-2017, 10:27 PM)venkat Wrote: Are you executing the same query in get_users() and get_user() method?

Yes!!

Then you can place one method in either model or model2 and use that same method in two controllers.

Doing that could confuse my pretend fellow developers, there must be an another way!


   Then you can write the query in one model and use that same method  in another model.
   hope this below link is useful
   http://stackoverflow.com/questions/10021...de-igniter

Never mind that link, I got it now! I'll use composition! This is a perfect candidate for an oop principle called composition, wohoo! This is the first time I'm actually going to use a technique like this XD
Reply


Messages In This Thread
Model concept question - by meSmashsta - 01-15-2017, 10:16 PM
RE: Model concept question - by venkat - 01-15-2017, 10:27 PM
RE: Model concept question - by meSmashsta - 01-15-2017, 10:40 PM
RE: Model concept question - by venkat - 01-16-2017, 12:40 AM
RE: Model concept question - by meSmashsta - 01-16-2017, 01:09 AM
RE: Model concept question - by venkat - 01-16-2017, 02:00 AM
RE: Model concept question - by meSmashsta - 01-16-2017, 02:20 AM
RE: Model concept question - by InsiteFX - 01-16-2017, 05:50 AM
RE: Model concept question - by Wouter60 - 01-16-2017, 09:04 AM
RE: Model concept question - by meSmashsta - 01-17-2017, 04:06 AM
RE: Model concept question - by InsiteFX - 01-17-2017, 04:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB