Joe Atzberger a écrit : > 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.
let me be more precise : do you agree that $table->select({fieldname => "value"}) is SQL somewhere : fieldname. If we change fieldname to newfieldname, with Koha as it's written now, you'll just have to dig C4 to find all occurrences of fieldname and update them. If you embeed $table->select... in a .pl, then that will be much more complex to maintain. + I really love to have a "high level" sub, that is fully DB independant (GetBorrowers(), GetBiblio()...) I'm not sure that what you answered me was the answer I was waiting for. I hope my concerne is now clear enough to be sure we are on the same way. Note : there are SQL statements in admin/ it's an historical reason : when I started to hack admin/script, I was a beginner at Perl. I'm not really proud of the code I wrote here, and, obviously, it should be rewritten. But as it works and nobody had time to do it... nobody did it. yet. -- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc NOUVEAU TELEPHONE : 04 91 81 35 08 _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel