Filename | /usr/share/koha/lib/Koha/QueryParser/Driver/PQF/query_plan.pm |
Statements | Executed 10 statements in 286µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 19µs | 220µs | BEGIN@2 | Koha::QueryParser::Driver::PQF::query_plan::
1 | 1 | 1 | 12µs | 23µs | BEGIN@4 | Koha::QueryParser::Driver::PQF::query_plan::
1 | 1 | 1 | 11µs | 24µs | BEGIN@5 | Koha::QueryParser::Driver::PQF::query_plan::
0 | 0 | 0 | 0s | 0s | target_syntax | Koha::QueryParser::Driver::PQF::query_plan::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Koha::QueryParser::Driver::PQF::query_plan; | ||||
2 | 3 | 36µs | 2 | 421µs | # spent 220µs (19+201) within Koha::QueryParser::Driver::PQF::query_plan::BEGIN@2 which was called:
# once (19µs+201µs) by Koha::QueryParser::Driver::PQF::BEGIN@9 at line 2 # spent 220µs making 1 call to Koha::QueryParser::Driver::PQF::query_plan::BEGIN@2
# spent 201µs making 1 call to base::import |
3 | |||||
4 | 3 | 30µs | 2 | 34µs | # spent 23µs (12+11) within Koha::QueryParser::Driver::PQF::query_plan::BEGIN@4 which was called:
# once (12µs+11µs) by Koha::QueryParser::Driver::PQF::BEGIN@9 at line 4 # spent 23µs making 1 call to Koha::QueryParser::Driver::PQF::query_plan::BEGIN@4
# spent 11µs making 1 call to strict::import |
5 | 3 | 218µs | 2 | 37µs | # spent 24µs (11+13) within Koha::QueryParser::Driver::PQF::query_plan::BEGIN@5 which was called:
# once (11µs+13µs) by Koha::QueryParser::Driver::PQF::BEGIN@9 at line 5 # spent 24µs making 1 call to Koha::QueryParser::Driver::PQF::query_plan::BEGIN@5
# spent 13µs making 1 call to warnings::import |
6 | |||||
7 | =head1 NAME | ||||
8 | |||||
- - | |||||
21 | sub target_syntax { | ||||
22 | my ($self, $server) = @_; | ||||
23 | my $pqf = ''; | ||||
24 | my $node_pqf; | ||||
25 | my $node_count = 0; | ||||
26 | |||||
27 | for my $node ( @{$self->query_nodes} ) { | ||||
28 | |||||
29 | if (ref($node)) { | ||||
30 | $node_pqf = $node->target_syntax($server); | ||||
31 | $node_count++ if $node_pqf; | ||||
32 | $pqf .= $node_pqf; | ||||
33 | } | ||||
34 | } | ||||
35 | $pqf = ($self->joiner eq '|' ? ' @or ' : ' @and ') x ($node_count - 1) . $pqf; | ||||
36 | $node_count = ($node_count ? '1' : '0'); | ||||
37 | for my $node ( @{$self->filters} ) { | ||||
38 | if (ref($node)) { | ||||
39 | $node_pqf = $node->target_syntax($server); | ||||
40 | $node_count++ if $node_pqf; | ||||
41 | $pqf .= $node_pqf; | ||||
42 | } | ||||
43 | } | ||||
44 | $pqf = ($self->joiner eq '|' ? ' @or ' : ' @and ') x ($node_count - 1) . $pqf; | ||||
45 | foreach my $modifier ( @{$self->modifiers} ) { | ||||
46 | my $modifierpqf = $modifier->target_syntax($server, $self); | ||||
47 | $pqf = $modifierpqf . ' ' . $pqf if $modifierpqf; | ||||
48 | } | ||||
49 | return ($self->negate ? '@not @attr 1=_ALLRECORDS @attr 2=103 "" ' : '') . $pqf; | ||||
50 | } | ||||
51 | |||||
52 | 1 | 3µs | 1; |