} @translated_descriptions ];
}
+
+
+=head3 can_be_deleted
+
+my $can_be_deleted = Koha::ItemType->can_be_deleted();
+
+Counts up the number of biblioitems and items with itemtype (code) and hands back the combined number of biblioitems and items with the itemtype
+
+=cut
+
+sub can_be_deleted {
+ my ($self) = @_;
+ my $nb_items = Koha::Items->search( { itype => $self->itemtype } )->count;
+ my $nb_biblioitems = Koha::Biblioitems->search( { itemtype => $self->itemtype } )->count;
+ return $nb_items + $nb_biblioitems == 0 ? 1 : 0;
+}
+
=head3 type
=cut