https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22407 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #1)
Yes, and no.
You can only do that if you know the patron has a guarantor, which is not always true.
You must do: sub guarantor { my ( $self ) = @_; my $guarantor_rs = $self->_result->guarantorid; return unless $guarantor_rs; return Koha::Patron->_new_from_dbic($guarantor_rs); }
I am definitely in favor of that, we should have a guideline about it IMO.
The pattern should cover the one-to-many use case as well. And yes, the idea is to propose a coding guideline! -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.