* Updated WHATSNEW.txt.
[dbsrgits/DBIx-Class.git] / t / lib / DBIC / DebugObj.pm
CommitLineData
67e1ac6d 1package # hide from PAUSE
2 DBIC::DebugObj;
9b459129 3
4use strict;
5use warnings;
6
7use Exporter;
8use Class::C3;
9
10use base qw/DBIx::Class::Storage::Statistics/;
11use base qw/Exporter/;
12use base qw/Class::Accessor::Fast/;
13
14__PACKAGE__->mk_accessors( qw/dbictest_sql_ref dbictest_bind_ref/ );
15
16
17=head2 new(PKG, SQL_REF, BIND_REF, ...)
18
19Creates a new instance that on subsequent queries will store
20the generated SQL to the scalar pointed to by SQL_REF and bind
21values to the array pointed to by BIND_REF.
22
23=cut
24
25sub new {
26 my $pkg = shift;
27 my $sql_ref = shift;
28 my $bind_ref = shift;
29
30 my $self = $pkg->SUPER::new(@_);
31
32 $self->debugfh(undef);
33
34 $self->dbictest_sql_ref($sql_ref);
35 $self->dbictest_bind_ref($bind_ref);
36
37 return $self;
38}
39
40sub query_start {
41 my $self = shift;
42
43 (${$self->dbictest_sql_ref}, @{$self->dbictest_bind_ref}) = @_;
44}
45
46sub query_end { }
47
48sub txn_start { }
49
50sub txn_commit { }
51
52sub txn_rollback { }
53
541;