Bug 31889: (follow-up) Correct item order
[koha-ffzg.git] / Koha / ItemType.pm
index f15c00e..4b77433 100644 (file)
@@ -17,9 +17,8 @@ package Koha::ItemType;
 
 use Modern::Perl;
 
-use Carp;
 
-use C4::Koha;
+use C4::Koha qw( getitemtypeimagelocation );
 use C4::Languages;
 use Koha::Database;
 use Koha::CirculationRules;
@@ -81,7 +80,7 @@ sub translated_descriptions {
         {   entity => 'itemtypes',
             code   => $self->itemtype,
         }
-    );
+    )->as_list;
     return [ map {
         {
             lang => $_->lang,
@@ -153,6 +152,17 @@ sub parent {
 
 }
 
+=head3 children_with_localization
+
+    Returns the ItemType objects of the children of this type or undef.
+
+=cut
+
+sub children_with_localization {
+    my ( $self ) = @_;
+    return Koha::ItemTypes->search_with_localization({ parent_type => $self->itemtype });
+}
+
 =head3 type
 
 =cut