Bug 11015: add copyright headers to some files
[koha.git] / Koha / QueryParser / Driver / PQF / query_plan / filter.pm
blobab6358e4af8f40dd4b4e269df25eee37e6bcea3b
1 package Koha::QueryParser::Driver::PQF::query_plan::filter;
3 # This file is part of Koha.
5 # Copyright 2012 C & P Bibliography Services
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
20 use base 'OpenILS::QueryParser::query_plan::filter';
22 use strict;
23 use warnings;
25 =head1 NAME
27 Koha::QueryParser::Driver::PQF::query_plan::filter - filter subclass for PQF driver
29 =head1 FUNCTIONS
31 =head2 Koha::QueryParser::Driver::PQF::query_plan::filter::target_syntax
33 my $pqf = $filter->target_syntax($server);
35 Transforms an OpenILS::QueryParser::query_plan::filter object into PQF. Do not use
36 directly.
38 =cut
40 sub target_syntax {
41 my ($self, $server) = @_;
42 my $attributes = $self->plan->QueryParser->bib1_mapping_by_name( 'filter', $self->name, $server );
44 if ($attributes->{'target_syntax_callback'}) {
45 return $attributes->{'target_syntax_callback'}->($self->plan->QueryParser, $self->name, $self->args, $self->negate, $server);
46 } else {
47 return '';