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

--- Comment #18 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 203581
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203581&action=edit
Bug 43269: Add Koha::ItemTypes->description_for

    my $desc = Koha::ItemTypes->description_for({ itemtype => $code });

Adds a cached class method that resolves an item type code to its
translated description. Pre-fetches all item types on first access
using Koha::Cache::Memory::Lite (per-request cache, since
translated_description depends on language context).

Cache key: ItemTypes:description_for (Memory::Lite)

Returns the item type code as fallback if not found.

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
   k$ prove t/db_dependent/Koha/ItemTypes.t
=> SUCCESS: Tests pass!
3. Sign off :-D

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to