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