https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35508

--- Comment #22 from Kyle M Hall (khall) <[email protected]> ---
(In reply to Katrin Fischer from comment #20)
> Wondering:
> 
> Koha/Patron/Attribute.pm
> 
> +    C4::Context->dbh->do(
> +        "UPDATE borrowers SET updated_on = NOW() WHERE borrowernumber = ?",
> undef,
> +        $self->borrowernumber
> +    );
> +
> 
> Should this really be SQL here?

This is one of those cases where direct SQL is definitely the best solution. If
we were to use DBIC we would have to perform at least one lookup, if not two.

We could in theory pass the calling object ( i.e. the borrower ) into the
accessor method on construction to reduce the needed lookups ( basically pass
the borrower object into new and have it cached in $self for a 'patron' method
to return without a lookup ). This is more of an architectural issue and is a
bit outside the scope but I've be happy to work on it if you file a followup
bug and assign it to me!

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to