Added Ability to Join Classes

0 views
Skip to first unread message

Nick DeNardis

unread,
Nov 11, 2006, 8:21:06 AM11/11/06
to PHPSimpl
As of rev 128 you can now create two DbTemplate classes, Join them
together and return rows from both tables with a simple GetList(). This
change is fully backwards compatible and should not effect any existing
code.

Although we have found that is you in the past would put multiple items
in the display_order without making them an array this will no longer
function correctly, it the past it functioned correctly by luck, if you
need multiple display_orders please send them as an array.

Here is a Quick Example:
// Create the Registration class
$myRegistration = new Registration;
$display[] =
array('registration_id','user_id','date_registered','guests');

// Create the User Class
$tmpUser = new Users;
$myRegistration->Join($tmpUser, 'user_id', 'INNER');
$display[] = array('first_name','last_name');

// Create the Payments Class
$tmpPayment = new Payment;
$myRegistration->Join($tmpPayment, 'conference_id', 'INNER');
$display[] = array('conference_id', 'amount', 'status', 'method');

// Get a list of all the Registrations
$myRegistration->GetList($display,'date_registered','DESC');

This will be integrated into the Example in the repo shortly.

Nick DeNardis

unread,
Nov 11, 2006, 9:40:06 AM11/11/06
to PHPSimpl
Bug Fix.
rev. 129 Fixes a bug with the filtered search for the GetList(), this
is effected if you are joining or not. It is recommended that you use
this revision or later over the 128 revision.
Reply all
Reply to author
Forward
0 new messages