Welcome Guest, Not a member yet? Register   Sign In
Where to put custom classes?
#8

[eluser]DisgruntledGoat[/eluser]
I'm not sure that the current answers really solve the problem (although the Datamapper DMZ looks interesting).

Let's say I have a bunch of products. When I load a product page I would use the Product_model to load the item from the database, into an anonymous stdClass. This is OK for most situations, but then if I want to operate on the data in some way I'm adding more stuff to the model (which doesn't really seem fit for that purpose). Plus you can't really create an array of Product_models.

A library doesn't seem to fit either as they just look like function collections again. It would be better to have a self-contained Product class with its own members and methods. Should I just include separate PHP files as/when I need them?


Messages In This Thread
Where to put custom classes? - by El Forum - 09-07-2010, 04:20 AM
Where to put custom classes? - by El Forum - 09-07-2010, 06:42 AM
Where to put custom classes? - by El Forum - 09-07-2010, 07:07 AM
Where to put custom classes? - by El Forum - 09-07-2010, 07:53 AM
Where to put custom classes? - by El Forum - 09-07-2010, 08:58 AM
Where to put custom classes? - by El Forum - 09-07-2010, 10:09 AM
Where to put custom classes? - by El Forum - 09-07-2010, 10:29 AM
Where to put custom classes? - by El Forum - 09-14-2010, 04:07 AM
Where to put custom classes? - by El Forum - 09-14-2010, 05:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB