View | Details | Raw Unified | Return to bug 18093
Collapse All | Expand All

(-)a/Koha/Objects.pm (-1 / +12 lines)
Lines 252-257 sub unblessed { Link Here
252
    return [ map { $_->unblessed } $self->as_list ];
252
    return [ map { $_->unblessed } $self->as_list ];
253
}
253
}
254
254
255
=head3 Koha::Objects->get_column
256
257
Return all the values of this set for a given column
258
259
=cut
260
261
sub get_column {
262
    my ($self, $column_name) = @_;
263
    return $self->_resultset->get_column( $column_name )->all;
264
}
265
255
=head3 Koha::Objects->TO_JSON
266
=head3 Koha::Objects->TO_JSON
256
267
257
Returns an unblessed representation of objects, suitable for JSON output.
268
Returns an unblessed representation of objects, suitable for JSON output.
Lines 335-341 Currently count, pager, update and delete are covered. Link Here
335
sub AUTOLOAD {
346
sub AUTOLOAD {
336
    my ( $self, @params ) = @_;
347
    my ( $self, @params ) = @_;
337
348
338
    my @known_methods = qw( count pager update delete result_class single get_column );
349
    my @known_methods = qw( count pager update delete result_class single );
339
    my $method = our $AUTOLOAD;
350
    my $method = our $AUTOLOAD;
340
    $method =~ s/.*:://;
351
    $method =~ s/.*:://;
341
352
(-)a/t/db_dependent/Koha/Objects.t (-2 / +1 lines)
Lines 131-137 subtest 'get_column' => sub { Link Here
131
    plan tests => 1;
131
    plan tests => 1;
132
    my @cities = Koha::Cities->search;
132
    my @cities = Koha::Cities->search;
133
    my @city_names = map { $_->city_name } @cities;
133
    my @city_names = map { $_->city_name } @cities;
134
    is_deeply( [ Koha::Cities->search->get_column('city_name')->all ], \@city_names, 'Koha::Objects->get_column should be allowed' );
134
    is_deeply( [ Koha::Cities->search->get_column('city_name') ], \@city_names, 'Koha::Objects->get_column should be allowed' );
135
};
135
};
136
136
137
subtest 'Exceptions' => sub {
137
subtest 'Exceptions' => sub {
138
- 

Return to bug 18093