|
Lines 43-48
use Koha::CurbsidePickups;
Link Here
|
| 43 |
use Koha::Old::Checkouts; |
43 |
use Koha::Old::Checkouts; |
| 44 |
use Koha::Patron::Attributes; |
44 |
use Koha::Patron::Attributes; |
| 45 |
use Koha::Patron::Categories; |
45 |
use Koha::Patron::Categories; |
|
|
46 |
use Koha::Patron::Consents; |
| 46 |
use Koha::Patron::Debarments; |
47 |
use Koha::Patron::Debarments; |
| 47 |
use Koha::Patron::HouseboundProfile; |
48 |
use Koha::Patron::HouseboundProfile; |
| 48 |
use Koha::Patron::HouseboundRole; |
49 |
use Koha::Patron::HouseboundRole; |
|
Lines 2196-2201
sub virtualshelves {
Link Here
|
| 2196 |
return Koha::Virtualshelves->_new_from_dbic( scalar $self->_result->virtualshelves ); |
2197 |
return Koha::Virtualshelves->_new_from_dbic( scalar $self->_result->virtualshelves ); |
| 2197 |
} |
2198 |
} |
| 2198 |
|
2199 |
|
|
|
2200 |
=head3 consent |
| 2201 |
|
| 2202 |
my $consent = $patron->consent(TYPE); |
| 2203 |
|
| 2204 |
Returns the first consent of type TYPE (there should be only one) or a new instance |
| 2205 |
of Koha::Patron::Consent. |
| 2206 |
|
| 2207 |
=cut |
| 2208 |
|
| 2209 |
sub consent { |
| 2210 |
my ( $self, $type ) = @_; |
| 2211 |
Koha::Exceptions::MissingParameter->throw('Missing consent type') |
| 2212 |
if !$type; |
| 2213 |
my $consents = Koha::Patron::Consents->search({ |
| 2214 |
borrowernumber => $self->borrowernumber, |
| 2215 |
type => $type, |
| 2216 |
}); |
| 2217 |
return $consents && $consents->count |
| 2218 |
? $consents->next |
| 2219 |
: Koha::Patron::Consent->new({ borrowernumber => $self->borrowernumber, type => $type }); |
| 2220 |
} |
| 2221 |
|
| 2199 |
=head2 Internal methods |
2222 |
=head2 Internal methods |
| 2200 |
|
2223 |
|
| 2201 |
=head3 _type |
2224 |
=head3 _type |