use Carp;
+use Koha::Patrons;
+
use base qw(Koha::Object);
=head1 NAME
=cut
-=head3 type
+=head3 patrons_using
+
+my $count = $provider->patrons_using()
+
+Gives the number of patrons using this provider
+
+=cut
+
+sub patrons_using {
+ my ( $self ) = @_;
+
+ return Koha::Patrons->search( { sms_provider_id => $self->id } )->count();
+}
+
+=head3 _type
=cut
-sub type {
+sub _type {
return 'SmsProvider';
}