Lines 280-286
sub columns {
Link Here
|
280 |
return Koha::Database->new->schema->resultset( $class->_type )->result_source->columns; |
280 |
return Koha::Database->new->schema->resultset( $class->_type )->result_source->columns; |
281 |
} |
281 |
} |
282 |
|
282 |
|
|
|
283 |
=head3 AUTOLOAD |
283 |
|
284 |
|
|
|
285 |
The autoload method is used call DBIx::Class method on a resultset. |
286 |
|
287 |
Important: If you plan to use one of the DBIx::Class methods you must provide |
288 |
relevant tests in t/db_dependent/Koha/Objects.t |
289 |
Currently count, pager, reset and update are covered. |
290 |
|
291 |
=cut |
292 |
|
293 |
sub AUTOLOAD { |
294 |
my ( $self, @params ) = @_; |
295 |
|
296 |
my $method = our $AUTOLOAD; |
297 |
$method =~ s/.*:://; |
298 |
|
299 |
my $r = eval { $self->_resultset->$method(@params) }; |
300 |
if ( $@ ) { |
301 |
carp "No method $method found for " . ref($self) . " " . $@; |
302 |
return |
303 |
} |
304 |
return $r; |
305 |
} |
284 |
|
306 |
|
285 |
=head3 _type |
307 |
=head3 _type |
286 |
|
308 |
|
287 |
- |
|
|