[Koha-bugs] [Bug 13019] Add base classes on which to build Koha objects

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Oct 2 14:25:09 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13019

--- Comment #4 from Jonathan Druart <jonathan.druart at biblibre.com> ---
I tried to make Koha::Borrower extends Koha::Schema::Result::Borrower, but I
get an error.
The idea was to remove the AUTOLOAD and avoid the IsStored, IsChanged, Id, etc.
methods.

[the error was: Unable to perform storage-dependent operations with a detached
result source (source '_unnamed_' is not associated with a schema)]
I suppose I tried to do something very bad :)

So, some additional remarks on the patch:
- "result" and "columns" should be _result and _columns to avoid collisions
later, don't you think?
- Are you sure it is useful to test if the row is stored and has been changed
(Store method)? Not sure about the perf, maybe DBIC does that (?).
- IsStored should be InStorage or completely removed, if useless.
- Delete could call delete in an eval, to avoid a call to in_storage
- what about 2 constructors? new and new_from_rs? The ResultSet should not be
create if not used later
- what about a _result method? It would return ->{_result} if already exists,
otherwise create it. All occurrences to ->{result} will be replaced by
->_result

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list