• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Resuable models

#6
[eluser]jedd[/eluser]
Quote:Unfortunatly you didn't got the problem.

Oh, rest assured I got the problem okay.

You ring a doctor and say 'I keep slamming my fingers in my drawer' -- rather than take your fingers out of the drawer, you suggest the best solution is a prescription for painkillers.

Quote:the question is plain simple and clear. How to reuse a model.

It's not simple - for the genuinely simple reason that no one else around here is going to think like this, and consequently your question makes as much sense as a nonsensical thing.

If you insist on going down the path of silliness, then here's how you might do it. I say might, as there's no 'best practice' for dumb.

Extend Model using MY_Model.

Within MY_Model have a method that takes the relevant details for your book or magazine, and also a parameter for whether it's a book or a magazine. Then in your actual book and magazine models, which extend MY_Model, you call $this->functionwhatever(...)


One final note:
Quote:i don't want to have all the stuff in ONE table due to performance and size issues

Having your data duplicated / split across multiple tables will make the size larger.

Your performance will decrease as you continue to write bad code to wrap around your bad design.


And I'm flattered that you thought I sounded merely a bit arrogant. I've tried harder in this message. Wink


Messages In This Thread
Resuable models - by El Forum - 08-04-2009, 06:45 AM
Resuable models - by El Forum - 08-04-2009, 07:23 AM
Resuable models - by El Forum - 08-04-2009, 07:28 AM
Resuable models - by El Forum - 08-04-2009, 07:28 AM
Resuable models - by El Forum - 08-04-2009, 07:30 AM
Resuable models - by El Forum - 08-04-2009, 07:37 AM
Resuable models - by El Forum - 08-04-2009, 07:45 AM
Resuable models - by El Forum - 08-04-2009, 10:27 AM
Resuable models - by El Forum - 08-04-2009, 12:05 PM
Resuable models - by El Forum - 08-04-2009, 01:47 PM
Resuable models - by El Forum - 09-07-2009, 04:13 PM
Resuable models - by El Forum - 09-07-2009, 04:35 PM
Resuable models - by El Forum - 09-08-2009, 01:05 AM
Resuable models - by El Forum - 09-08-2009, 04:01 AM
Resuable models - by El Forum - 09-08-2009, 04:51 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.