[Koha-bugs] [Bug 17499] Koha objects for messaging preferences

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon May 29 11:58:03 CEST 2017


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

Lari Taskula <lari.taskula at jns.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #63433|0                           |1
        is obsolete|                            |

--- Comment #15 from Lari Taskula <lari.taskula at jns.fi> ---
Created attachment 63792
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63792&action=edit
Bug 17499: Improve object usability by enabling direct access to transport
preferences

Since messaging preference is a feature that has multiple related database
tables,
usage via Koha-objects is sometimes frustrating.

This patch adds a feature for Koha::Patron::Message::Preference which enables
access to message transport preferences directly via this object. It allows us
to skip calls to Koha::Patron::Message::Transport::Preference(s) because we can
now get and set via K::P::M::Preference.

Get:
$preference->message_transport_types
Returns a hashref, where each key is stored transport type and value for the
key
is letter code for the transport.

Set:
$preference->set({ message_transport_types => ['sms'] }) or
$preference->message_transport_types('email', 'sms') or
$preference->message_transport_types(['email', 'sms'])
Returns $self (Koha::Patron::Message::Preference object)

To test:
1. Run t/db_dependent/Koha/Patron/Message/Preferences.t

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


More information about the Koha-bugs mailing list