Bug 23049: (follow-up) Types should not be deletable
[koha-ffzg.git] / Koha / ItemType.pm
index 31578f0..e33f0e6 100644 (file)
@@ -25,7 +25,7 @@ use Koha::Database;
 use Koha::IssuingRules;
 use Koha::Localizations;
 
-use base qw(Koha::Object);
+use base qw(Koha::Object Koha::Object::Limit::Library);
 
 =head1 NAME
 
@@ -33,7 +33,7 @@ Koha::ItemType - Koha Item type Object class
 
 =head1 API
 
-=head2 Class Methods
+=head2 Class methods
 
 =cut
 
@@ -125,6 +125,20 @@ sub may_article_request {
     return ( $guess->{ $itemtype // q{} } || $guess->{ '*' } ) ? 1 : q{};
 }
 
+=head3 _library_limits
+
+ configure library limits
+
+=cut
+
+sub _library_limits {
+    return {
+        class => "ItemtypesBranch",
+        id => "itemtype",
+        library => "branchcode",
+    };
+}
+
 =head3 type
 
 =cut