Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
my $self = shift;
if ( !$self->type->repeatable ) {
- my $attr_count
- = Koha::Database->new->schema->resultset( $self->_type )->search(
+ my $attr_count = Koha::Patron::Attributes->search(
{ borrowernumber => $self->borrowernumber,
code => $self->code
}
my $self = shift;
if ( $self->type->unique_id ) {
- my $unique_count
- = Koha::Database->new->schema->resultset( $self->_type )
+ my $unique_count = Koha::Patron::Attributes
->search( { code => $self->code, attribute => $self->attribute } )
->count;
Koha::Exceptions::Patron::Attribute::UniqueIDConstraint->throw()