|
Lines 29-49
Koha::REST::Plugin::Objects
Link Here
|
| 29 |
|
29 |
|
| 30 |
=head2 Helper methods |
30 |
=head2 Helper methods |
| 31 |
|
31 |
|
| 32 |
=head3 objects.search |
32 |
=cut |
|
|
33 |
|
| 34 |
sub register { |
| 35 |
my ( $self, $app ) = @_; |
| 36 |
|
| 37 |
=head3 objects.find |
| 33 |
|
38 |
|
| 34 |
my $patrons_rs = Koha::Patrons->new; |
39 |
my $patrons_rs = Koha::Patrons->new; |
| 35 |
my $patrons = $c->objects->search( $patrons_rs ); |
40 |
my $patrons = $c->objects->find( $patrons_rs, $id ); |
| 36 |
|
41 |
|
| 37 |
Performs a database search using given Koha::Objects object and query parameters. |
42 |
Performs a database search using given Koha::Objects object and the $id. |
| 38 |
|
43 |
|
| 39 |
Returns an arrayref of the hashrefs representing the resulting objects |
44 |
Returns I<undef> if no object is found Returns the I<API representation> of |
| 40 |
for API rendering. |
45 |
the requested object. It passes through any embeds if specified. |
| 41 |
|
46 |
|
| 42 |
=cut |
47 |
=cut |
| 43 |
|
48 |
|
| 44 |
sub register { |
|
|
| 45 |
my ( $self, $app ) = @_; |
| 46 |
|
| 47 |
$app->helper( |
49 |
$app->helper( |
| 48 |
'objects.find' => sub { |
50 |
'objects.find' => sub { |
| 49 |
my ( $c, $result_set, $id ) = @_; |
51 |
my ( $c, $result_set, $id ) = @_; |
|
Lines 66-71
sub register {
Link Here
|
| 66 |
} |
68 |
} |
| 67 |
); |
69 |
); |
| 68 |
|
70 |
|
|
|
71 |
=head3 objects.search |
| 72 |
|
| 73 |
my $patrons_rs = Koha::Patrons->new; |
| 74 |
my $patrons = $c->objects->search( $patrons_rs ); |
| 75 |
|
| 76 |
Performs a database search using given Koha::Objects object and query parameters. |
| 77 |
|
| 78 |
Returns an arrayref of the hashrefs representing the resulting objects |
| 79 |
for API rendering. |
| 80 |
|
| 81 |
=cut |
| 82 |
|
| 69 |
$app->helper( |
83 |
$app->helper( |
| 70 |
'objects.search' => sub { |
84 |
'objects.search' => sub { |
| 71 |
my ( $c, $result_set ) = @_; |
85 |
my ( $c, $result_set ) = @_; |
| 72 |
- |
|
|