c3a66e4c12339ec1e6c518d04d7c80dce928c392
[koha.git] / Koha / QueryParser / Driver / PQF / query_plan / modifier.pm
1 package Koha::QueryParser::Driver::PQF::query_plan::modifier;
2 use base 'OpenILS::QueryParser::query_plan::modifier';
3
4 use strict;
5 use warnings;
6
7 =head2 Koha::QueryParser::Driver::PQF::query_plan::modifier::target_syntax
8
9     my $pqf = $modifier->target_syntax($server, $query_plan);
10
11 Transforms an OpenILS::QueryParser::query_plan::modifier object into PQF. Do not use
12 directly. The second argument points ot the query_plan, since modifiers do
13 not have a reference to their parent query_plan.
14
15 =cut
16
17 sub target_syntax {
18     my ($self, $server, $query_plan) = @_;
19     my $pqf = '';
20     my @fields;
21
22     my $attributes = $query_plan->QueryParser->bib1_mapping_by_name('modifier', $self->name, $server);
23     $pqf = ($attributes->{'op'} ? $attributes->{'op'} . ' ' : '') . ($self->negate ? '@not @attr 1=_ALLRECORDS @attr 2=103 "" ' : '') . $attributes->{'attr_string'};
24     return $pqf;
25 }
26
27 1;