Paul -- I think you mean all the SQL should be in C4, and yes I agree with that. C4::Table does not receive any SQL as arguments to select, insert or delete. I.E., it preserves the encapsulation of SQL inside C4/*. This would speed up development of features because a C4/NewFeature.pm module might not be necessary at all, or could focus on things special to NewFeature besides basic table operations. Once a table is added to the DB, C4::Table can access it, no new code necessary. And the other code will be more recognizable, using the same kind of $table->select({fieldname=>"value"}) statements. Would be nice to be able to use the same OO code accessing issues and old_issues, or any of the XX and old_XX tables, for example. --Joe On Tue, Nov 4, 2008 at 12:43 PM, Paul POULAIN <paul.poulain@free.fr> wrote:
Joe Atzberger a écrit :
The purpose of Table is to provide all the basic functionality that is reimplemented multiple times throughout Koha for each DB table. This code is considered experimental and does not yet supplant any production code. Please examine and test, like: use C4::Table; my $table = C4::Table->new("borrowers"); my $set = $table->select({surname=>"Smith", sort=>"branchcode,firstname"});
Hi Joe,
do we agree that it doesn't mean there will be those statements in Perl ? I think having all Perl in C4/*.pm is a good way. So, this C4::Table will be used in .pm. agreed ?
-- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc NOUVEAU TELEPHONE : 04 91 81 35 08