use C4::Auth;
-use Koha::Borrowers;
+use Koha::Patrons;
use Koha::Database;
use Koha::DateUtils qw( dt_from_string );
use Koha::Exceptions;
sub store {
my ( $self ) = @_;
+ unless ( $self->owner ) {
+ Koha::Exceptions::Virtualshelves::UseDbAdminAccount->throw;
+ }
+
unless ( $self->is_shelfname_valid ) {
Koha::Exceptions::Virtualshelves::DuplicateObject->throw;
}
return 0 unless $borrowernumber;
return 1 if $self->owner == $borrowernumber;
- my $patron = Koha::Borrowers->find( $borrowernumber );
+ my $patron = Koha::Patrons->find( $borrowernumber );
return 1 if $self->category == $PUBLIC and C4::Auth::haspermission( $patron->userid, { lists => 'delete_public_lists' } );
return 0;
}
-sub type {
+sub _type {
return 'Virtualshelve';
}