Lines 28-33
use Koha::Illrequest;
Link Here
|
28 |
use Koha::Illrequestattributes; |
28 |
use Koha::Illrequestattributes; |
29 |
use Koha::Patron; |
29 |
use Koha::Patron; |
30 |
use Mail::Sendmail; |
30 |
use Mail::Sendmail; |
|
|
31 |
use Try::Tiny; |
31 |
|
32 |
|
32 |
use base qw(Koha::Object); |
33 |
use base qw(Koha::Object); |
33 |
|
34 |
|
Lines 157-162
sub _backend {
Link Here
|
157 |
return $self->{_my_backend}; |
158 |
return $self->{_my_backend}; |
158 |
} |
159 |
} |
159 |
|
160 |
|
|
|
161 |
=head3 _backend_capability |
162 |
|
163 |
my $backend_capability_result = $self->_backend_capability($name, $args); |
164 |
|
165 |
This is a helper method to invoke optional capabilities in the backend. If |
166 |
the capability named by $name is not supported, return 0, else invoke it, |
167 |
passing $args along with the invocation, and return its return value. |
168 |
|
169 |
=cut |
170 |
|
171 |
sub _backend_capability { |
172 |
my ( $self, $name, $args ) = @_; |
173 |
my $capability = 0; |
174 |
try { |
175 |
$capability = $self->_backend->capabilities($name); |
176 |
} catch { |
177 |
return 0; |
178 |
}; |
179 |
if ( $capability ) { |
180 |
return $capability($args); |
181 |
} else { |
182 |
return 0; |
183 |
} |
184 |
} |
185 |
|
160 |
=head3 _config |
186 |
=head3 _config |
161 |
|
187 |
|
162 |
my $config = $abstract->_config($config); |
188 |
my $config = $abstract->_config($config); |
163 |
- |
|
|