Statement/Placeholder.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 2 / 2 totaltotal 100% 32 / 32 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Dialects/ANSI.pm ↑ Summary
1 package SQL::Statement::Placeholder;
2  
3 ######################################################################
4 #
5 # This module is copyright (c), 2009-2020 by Jens Rehsack.
6 # All rights reserved.
7 #
8 # It may be freely distributed under the same terms as Perl itself.
9 # See below for help and copyright information (search for SYNOPSIS).
10 #
11 ######################################################################
12  
13 16 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 16 ▶use warnings FATAL => "all";
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 16 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
17 16 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 16 ▶use SQL::Statement::Term ();
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 16 our $VERSION = '1.414';
22  
23 16 @ISA = qw(SQL::Statement::Term);
24  
25 =pod
26  
27 =head1 NAME
28  
29 SQL::Statement::Placeholder - implements getting the next placeholder value
30  
31 =head1 SYNOPSIS
32  
33 # create an placeholder term with an SQL::Statement object as owner
34 # and the $argnum of the placeholder.
35 my $term = SQL::Statement::Placeholder->new( $owner, $argnum );
36 # access the result of that operation
37 $term->value( $eval );
38  
39 =head1 DESCRIPTION
40  
41 SQL::Statement::Placeholder implements getting the next placeholder value.
42 Accessing a specific placeholder is currently unimplemented and not tested.
43  
44 =head1 INHERITANCE
45  
46 SQL::Statement::Placeholder
47 ISA SQL::Statement::Term
48  
49 =head1 METHODS
50  
51 =head2 new
52  
53 Instantiates a new C<SQL::Statement::Placeholder> instance.
54  
55 =head2 value
56  
57 Returns the value of the next placeholder.
58  
59 =cut
60  
61 sub new
62 28 ▶{
Subroutine new: called CC=1 SCAR=0.0
Pod documented
63 28 my ( $class, $owner, $argnum ) = @_;
64  
65 28 my $self = $class->SUPER::new($owner);
66 28 $self->{ARGNUM} = $argnum;
67  
68 28 return $self;
69 }
70  
71 sub value($)
72 107 ▶{
Subroutine value: called CC=1 SCAR=0.0
Pod documented
73  
74 # from S::S->get_row_value():
75 # my $val = (
76 # $self->{join}
77 # or !$eval
78 # or ref($eval) =~ /Statement$/
79 # ) ? $self->params($arg_num) : $eval->param($arg_num);
80  
81 # let's see where us will lead taking from params every time
82 # XXX later: return $_[0]->{OWNER}->{params}->[$_[0]->{ARGNUM}];
83 107 return $_[0]->{OWNER}->{params}->[ $_[0]->{OWNER}->{argnum}++ ];
84 }
85  
86 =head1 AUTHOR AND COPYRIGHT
87  
88 Copyright (c) 2009-2020 by Jens Rehsack: rehsackATcpan.org
89  
90 All rights reserved.
91  
92 You may distribute this module under the terms of either the GNU
93 General Public License or the Artistic License, as specified in
94 the Perl README file.
95  
96 =cut
97  
98 16 1;
« Dialects/ANSI.pm ↑ Summary