Welcome Guest, Not a member yet? Register   Sign In
Having a model extend another model
#1

[eluser]hcker2000[/eluser]
I'm trying to figure out a good way to help keep things DRY. For my example lets say I have some basic methods for a model as follows.

Code:
get_by_id
get_by_email
get_by_token

Now lets say I have a method that is specific to the public facing side of the site.
Code:
get_current_item

Now lets say I have some methods specific to the private side of the website (or admin).

Code:
get_all_items
delete_item
update_item

What seems to be ideal is to put those generic methods that could be used by the public or private side of a website into a model called generic. then in the front end model it could extend the generic model.

Is there any good way to do this type of setup with codeigniter? or is it better to just put all those methods in one model? It seams like models could get a bit monolithic if you just put all related methods in the one model vs extending.



Messages In This Thread
Having a model extend another model - by El Forum - 02-02-2012, 08:10 AM
Having a model extend another model - by El Forum - 02-02-2012, 08:39 AM
Having a model extend another model - by El Forum - 02-02-2012, 08:56 AM
Having a model extend another model - by El Forum - 02-02-2012, 08:59 AM
Having a model extend another model - by El Forum - 02-02-2012, 12:56 PM
Having a model extend another model - by El Forum - 02-02-2012, 02:14 PM
Having a model extend another model - by El Forum - 02-02-2012, 02:31 PM
Having a model extend another model - by El Forum - 02-13-2012, 04:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB