- $type =~ s|^Koha::Schema::Result::||;
- my $mappings = {
- Branch => [ qw( Koha::Library Koha::Libraries ) ],
- Borrower => [ qw( Koha::Patron Koha::Patrons ) ],
- OldIssue => [ qw( Koha::OldIssue Koha::OldIssues ) ],
- };
- return $mappings->{$type};
+
+ if( $type->can('koha_objects_class') ) {
+ return $type->koha_objects_class;
+ }
+ $type =~ s|Schema::Result::||;
+ return "${type}s";