[Koha-bugs] [Bug 19966] Add ability to pass objects directly to slips and notices

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Feb 20 21:20:12 CET 2018


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

--- Comment #4 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 72013
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=72013&action=edit
[FOR DISCUSSION] Bug 19966: Add Koha::Object->read_only

If ->read_only is called, only accessor methods will be allowed on this
object.

use Koha::Patrons;
my $p = Koha::Patrons->find(1);
say $p->borrowernumber;
$p->surname('another surname')->store;
say $p->surname;
=> Will work

$p = Koha::Patrons->find(1);
$p->read_only;
$p->surname('another surname again')->store;
=> Will explode

Problem:
use Koha::Patrons;
my $p = Koha::Patrons->find(1);
say $p->borrowernumber;
$p->read_only;
$p->{_read_only} = 0;
$p->surname('another surname again')->store;
=> Will not explode

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


More information about the Koha-bugs mailing list