https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29746 Bug ID: 29746 Summary: Add a handy Koha::Boolean class Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org The idea is to provide an OO class that can carry a boolean value, and also useful messages for feedback. An example usage: sub safe_to_delete { my ( $self ) = @_; my $result = Koha::Boolean->new; my $can = 1; if ( condition_1 ) { $can = 0; $result->add_message({ message => 'has_debt' }); } ... if ( condition_n ) { $can = 0; $result->add_message({ message => 'has_guarantees' }); } return $result->set_value($can); } -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.