Creating multiple instances of a model |
(04-28-2016, 09:51 AM)kilishan Wrote: Personally, I would separate the Customer entity from the model itself. What I mean is that I would have two classes: Customer and Customer_model. The model would be responsible for all interactions with the database. Then, the Customer class would represent a single customer. It would have any additional business logic needed inside of it, functions to get related entities, etc. You can have the query result object return custom classes, so your code would simplify into something like this: You can create multiple instances of a library? I thought Libraries were singletons as well. |
Messages In This Thread |
Creating multiple instances of a model - by CINewb - 04-28-2016, 06:52 AM
RE: Creating multiple instances of a model - by Wouter60 - 04-28-2016, 07:17 AM
RE: Creating multiple instances of a model - by CINewb - 04-28-2016, 07:52 AM
RE: Creating multiple instances of a model - by Narf - 04-28-2016, 09:51 AM
RE: Creating multiple instances of a model - by ciadmin - 04-28-2016, 09:12 AM
RE: Creating multiple instances of a model - by kilishan - 04-28-2016, 09:51 AM
RE: Creating multiple instances of a model - by CINewb - 04-28-2016, 10:16 AM
RE: Creating multiple instances of a model - by Shawn - 05-24-2016, 07:40 PM
RE: Creating multiple instances of a model - by kilishan - 05-24-2016, 07:54 PM
RE: Creating multiple instances of a model - by kilishan - 04-28-2016, 10:45 AM
RE: Creating multiple instances of a model - by CINewb - 04-28-2016, 11:21 AM
|