Add a new class that aims at providing a simple gateway between stored
data and php code when data are fetched 'as is'.
UseCase: classes like Phones or Addresses.
How to use:
/* Fetching the content of a entry */
$entry = new PlDBTableEntry('accounts', true /* autofetch */);
$entry->uid = 26071;
print $entry->hruid;
/* Iterating on entries and saving changes*/
$selector = new PlDBTableEntry('profile_phones');
$selector->pid = 26071;
$selector->link_type = 'pro';
foreach ($selector as $entry) {
$entry->comment = 'Professional phone number';
$entry->save();
}
Note: ATM, SQL joins are not supported, but this is planned for the
future with an API that might looks like:
$entry = new PlDBTableEntry(array($mainTable,
PlSqlJoin::left(),
PlSqlJoin::inner()));
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>