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

--- Comment #4 from Jonathan Druart <jonathan.dru...@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.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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