Welcome Guest, Not a member yet? Register   Sign In
Best practices using multiple object instances?
#2

[eluser]WanWizard[/eluser]
Instead of trying to make this yourself, why don't you look at Datamapper (DMZ, search the forum), which provides you with an object model per database table, including automatic relationships, cascading deletes, custom methods per object, pre-update/insert validations, etc.

The alternative is to store them in p.e. a classes subdirectory, and then do
Code:
if ( file_exists(APPPATH.'classes/'.$myclass) )
{
    require_once(APPPATH.'classes/'.$myclass);
}
else
{
    // catch the error here
}
$class = new Myclass();


Messages In This Thread
Best practices using multiple object instances? - by El Forum - 07-28-2010, 08:49 AM
Best practices using multiple object instances? - by El Forum - 07-28-2010, 09:07 AM
Best practices using multiple object instances? - by El Forum - 07-28-2010, 09:26 AM
Best practices using multiple object instances? - by El Forum - 07-28-2010, 09:35 AM
Best practices using multiple object instances? - by El Forum - 07-28-2010, 12:04 PM
Best practices using multiple object instances? - by El Forum - 07-31-2011, 09:20 PM
Best practices using multiple object instances? - by El Forum - 08-01-2011, 01:34 AM
Best practices using multiple object instances? - by El Forum - 08-11-2011, 06:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB