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

(-)a/Koha/QueryParser/Driver/PQF.pm (-2 / +2 lines)
Lines 338-344 sub bib1_mapping_by_attr_string { Link Here
338
}
338
}
339
339
340
=head2 clear_all_configuration
340
=head2 clear_all_configuration
341
    
341
342
    $QParser->clear_all_configuration
342
    $QParser->clear_all_configuration
343
343
344
Clear all configuration. This is a highly destructive method. You may
344
Clear all configuration. This is a highly destructive method. You may
Lines 370-376 sub clear_all_configuration { Link Here
370
}
370
}
371
371
372
=head2 clear_all_mappings
372
=head2 clear_all_mappings
373
    
373
374
    $QParser->clear_all_mappings
374
    $QParser->clear_all_mappings
375
375
376
Clear all bib-1 mappings.
376
Clear all bib-1 mappings.
(-)a/Koha/QueryParser/Driver/PQF/Util.pm (+16 lines)
Lines 4-9 use Scalar::Util qw(looks_like_number); Link Here
4
use strict;
4
use strict;
5
use warnings;
5
use warnings;
6
6
7
=head1 NAME
8
9
    Koha::QueryParser::Driver::PQF::Util - Utility module for PQF QueryParser driver
10
11
=head1 FUNCTIONS
12
13
=head2 attributes_to_attr_string
14
15
    Koha::QueryParser::Driver::PQF::Util(%attributes);
16
17
    Koha::QueryParser::Driver::PQF::Util({ '1' => '1003', '4' => '6' });
18
19
Convert a hashref with a Bib-1 mapping into its PQF string representation.
20
21
=cut
22
7
sub attributes_to_attr_string {
23
sub attributes_to_attr_string {
8
    my ($attributes) = @_;
24
    my ($attributes) = @_;
9
    my $attr_string = '';
25
    my $attr_string = '';
(-)a/Koha/QueryParser/Driver/PQF/query_plan.pm (+6 lines)
Lines 4-9 use base 'OpenILS::QueryParser::query_plan'; Link Here
4
use strict;
4
use strict;
5
use warnings;
5
use warnings;
6
6
7
=head1 NAME
8
9
Koha::QueryParser::Driver::PQF::query_plan - query_plan subclass for PQF driver
10
11
=head1 FUNCTIONS
12
7
=head2 Koha::QueryParser::Driver::PQF::query_plan::target_syntax
13
=head2 Koha::QueryParser::Driver::PQF::query_plan::target_syntax
8
14
9
    my $pqf = $query_plan->target_syntax($server);
15
    my $pqf = $query_plan->target_syntax($server);
(-)a/Koha/QueryParser/Driver/PQF/query_plan/facet.pm (+6 lines)
Lines 4-9 use base 'OpenILS::QueryParser::query_plan::facet'; Link Here
4
use strict;
4
use strict;
5
use warnings;
5
use warnings;
6
6
7
=head1 NAME
8
9
Koha::QueryParser::Driver::PQF::query_plan::facet - facet subclass for PQF driver
10
11
=head1 FUNCTIONS
12
7
=head2 Koha::QueryParser::Driver::PQF::query_plan::facet::target_syntax
13
=head2 Koha::QueryParser::Driver::PQF::query_plan::facet::target_syntax
8
14
9
    my $pqf = $facet->target_syntax($server);
15
    my $pqf = $facet->target_syntax($server);
(-)a/Koha/QueryParser/Driver/PQF/query_plan/filter.pm (+6 lines)
Lines 4-9 use base 'OpenILS::QueryParser::query_plan::filter'; Link Here
4
use strict;
4
use strict;
5
use warnings;
5
use warnings;
6
6
7
=head1 NAME
8
9
Koha::QueryParser::Driver::PQF::query_plan::filter - filter subclass for PQF driver
10
11
=head1 FUNCTIONS
12
7
=head2 Koha::QueryParser::Driver::PQF::query_plan::filter::target_syntax
13
=head2 Koha::QueryParser::Driver::PQF::query_plan::filter::target_syntax
8
14
9
    my $pqf = $filter->target_syntax($server);
15
    my $pqf = $filter->target_syntax($server);
(-)a/Koha/QueryParser/Driver/PQF/query_plan/modifier.pm (+6 lines)
Lines 4-9 use base 'OpenILS::QueryParser::query_plan::modifier'; Link Here
4
use strict;
4
use strict;
5
use warnings;
5
use warnings;
6
6
7
=head1 NAME
8
9
Koha::QueryParser::Driver::PQF::query_plan::modifer - modifier subclass for PQF driver
10
11
=head1 FUNCTIONS
12
7
=head2 Koha::QueryParser::Driver::PQF::query_plan::modifier::target_syntax
13
=head2 Koha::QueryParser::Driver::PQF::query_plan::modifier::target_syntax
8
14
9
    my $pqf = $modifier->target_syntax($server, $query_plan);
15
    my $pqf = $modifier->target_syntax($server, $query_plan);
(-)a/Koha/QueryParser/Driver/PQF/query_plan/node.pm (+6 lines)
Lines 4-9 use base 'OpenILS::QueryParser::query_plan::node'; Link Here
4
use strict;
4
use strict;
5
use warnings;
5
use warnings;
6
6
7
=head1 NAME
8
9
Koha::QueryParser::Driver::PQF::query_plan::node - node subclass for PQF driver
10
11
=head1 FUNCTIONS
12
7
=head2 Koha::QueryParser::Driver::PQF::query_plan::node::target_syntax
13
=head2 Koha::QueryParser::Driver::PQF::query_plan::node::target_syntax
8
14
9
    my $pqf = $node->target_syntax($server);
15
    my $pqf = $node->target_syntax($server);
(-)a/Koha/QueryParser/Driver/PQF/query_plan/node/atom.pm (+6 lines)
Lines 4-9 use base 'OpenILS::QueryParser::query_plan::node::atom'; Link Here
4
use strict;
4
use strict;
5
use warnings;
5
use warnings;
6
6
7
=head1 NAME
8
9
Koha::QueryParser::Driver::PQF::query_plan::node::atom - atom subclass for PQF driver
10
11
=head1 FUNCTIONS
12
7
=head2 Koha::QueryParser::Driver::PQF::query_plan::node::atom::target_syntax
13
=head2 Koha::QueryParser::Driver::PQF::query_plan::node::atom::target_syntax
8
14
9
    my $pqf = $atom->target_syntax($server);
15
    my $pqf = $atom->target_syntax($server);
(-)a/OpenILS/QueryParser.pm (-10 / +9 lines)
Lines 321-327 sub operator { Link Here
321
    my $opname = shift;
321
    my $opname = shift;
322
    my $op = shift;
322
    my $op = shift;
323
323
324
    return undef unless ($opname);
324
    return unless ($opname);
325
325
326
    $parser_config{$class}{operators} ||= {};
326
    $parser_config{$class}{operators} ||= {};
327
    $parser_config{$class}{operators}{$opname} = $op if ($op);
327
    $parser_config{$class}{operators}{$opname} = $op if ($op);
Lines 1488-1494 package OpenILS::QueryParser::query_plan; Link Here
1488
1488
1489
sub QueryParser {
1489
sub QueryParser {
1490
    my $self = shift;
1490
    my $self = shift;
1491
    return undef unless ref($self);
1491
    return unless ref($self);
1492
    return $self->{QueryParser};
1492
    return $self->{QueryParser};
1493
}
1493
}
1494
1494
Lines 1540-1546 sub _merge_filters { Link Here
1540
    my $right_filter = shift;
1540
    my $right_filter = shift;
1541
    my $join = shift;
1541
    my $join = shift;
1542
1542
1543
    return undef unless $left_filter or $right_filter;
1543
    return unless $left_filter or $right_filter;
1544
    return $right_filter unless $left_filter;
1544
    return $right_filter unless $left_filter;
1545
    return $left_filter unless $right_filter;
1545
    return $left_filter unless $right_filter;
1546
1546
Lines 1599-1605 sub collapse_filters { Link Here
1599
sub find_filter {
1599
sub find_filter {
1600
    my $self = shift;
1600
    my $self = shift;
1601
    my $needle = shift;;
1601
    my $needle = shift;;
1602
    return undef unless ($needle);
1602
    return unless ($needle);
1603
1603
1604
    my $filter = $self->collapse_filters($needle);
1604
    my $filter = $self->collapse_filters($needle);
1605
1605
Lines 1613-1619 sub find_filter { Link Here
1613
sub find_modifier {
1613
sub find_modifier {
1614
    my $self = shift;
1614
    my $self = shift;
1615
    my $needle = shift;;
1615
    my $needle = shift;;
1616
    return undef unless ($needle);
1616
    return unless ($needle);
1617
    return grep { $_->name eq $needle } @{ $self->modifiers };
1617
    return grep { $_->name eq $needle } @{ $self->modifiers };
1618
}
1618
}
1619
1619
Lines 2103-2127 sub new { Link Here
2103
2103
2104
sub node {
2104
sub node {
2105
    my $self = shift;
2105
    my $self = shift;
2106
    return undef unless (ref $self);
2106
    return unless (ref $self);
2107
    return $self->{node};
2107
    return $self->{node};
2108
}
2108
}
2109
2109
2110
sub content {
2110
sub content {
2111
    my $self = shift;
2111
    my $self = shift;
2112
    return undef unless (ref $self);
2112
    return unless (ref $self);
2113
    return $self->{content};
2113
    return $self->{content};
2114
}
2114
}
2115
2115
2116
sub prefix {
2116
sub prefix {
2117
    my $self = shift;
2117
    my $self = shift;
2118
    return undef unless (ref $self);
2118
    return unless (ref $self);
2119
    return $self->{prefix};
2119
    return $self->{prefix};
2120
}
2120
}
2121
2121
2122
sub suffix {
2122
sub suffix {
2123
    my $self = shift;
2123
    my $self = shift;
2124
    return undef unless (ref $self);
2124
    return unless (ref $self);
2125
    return $self->{suffix};
2125
    return $self->{suffix};
2126
}
2126
}
2127
2127
2128
- 

Return to bug 9239