File Coverage

blib/lib/DBIx/Class/AuditAny/Role/Collector.pm
Criterion Covered Total %
statement 12 16 75.0
branch n/a
condition n/a
subroutine 4 5 80.0
pod 1 1 100.0
total 17 22 77.2


line stmt bran cond sub pod time code
1             package DBIx::Class::AuditAny::Role::Collector;
2 13     13   6270 use strict;
  13         23  
  13         366  
3 13     13   66 use warnings;
  13         19  
  13         373  
4              
5             # ABSTRACT: Role for all Collector classes
6              
7 13     13   52 use Moo::Role;
  13         20  
  13         90  
8 13     13   16458 use MooX::Types::MooseLike::Base qw(:all);
  13         19  
  13         4800  
9              
10             =head1 NAME
11              
12             DBIx::Class::AuditAny::Role::Collector - Role for all Collector classes
13              
14             =head1 DESCRIPTION
15              
16             All classes which need to be able to function as a "Collector" class must consume this
17             base role.
18              
19             =head1 REQUIRES
20              
21             =head2 record_changes
22              
23             All Collectors must implement a C<record_changes()> method. This is what is called to send
24             the change/update data into the Collector for further processing and storage.
25              
26             =cut
27             requires 'record_changes';
28              
29             =head1 ATTRIBUTES
30              
31             =head2 AuditObj
32              
33             Required. Reference to the main AuditAny object which is sniffing the change data
34              
35             =cut
36             has 'AuditObj', is => 'ro', required => 1;
37              
38             =head2 writes_bound_schema_sources
39              
40             these are part of the base class because the AuditObj expects all
41             Collectors to know if a particular tracked source is also a source used
42             by the collector which would create a deep recursion situation. in other words,
43             we don't want to try to track changes of the tables that we're using to
44             store changes. We rely on the Collector to identify these exclude cases
45             my setting those source names here
46              
47             =cut
48             has 'writes_bound_schema_sources', is => 'ro', isa => ArrayRef[Str], lazy => 1, default => sub {[]};
49              
50             =head1 METHODS
51              
52             =head2 has_full_row_stored
53              
54             This is part of the "init" system for loading existing data. This is going
55             to be refactored/replaced, but with what is not yet known
56              
57             =cut
58             sub has_full_row_stored {
59 0     0 1   my $self = shift;
60 0           my $Row = shift;
61            
62 0           warn "has_full_row_stored() not implemented - returning false\n";
63            
64 0           return 0;
65             }
66              
67             1;
68              
69             __END__
70              
71             =head1 SEE ALSO
72              
73             =over
74              
75             =item *
76              
77             L<DBIx::Class::AuditAny>
78              
79             =item *
80              
81             L<DBIx::Class>
82              
83             =back
84              
85             =head1 SUPPORT
86            
87             IRC:
88            
89             Join #rapidapp on irc.perl.org.
90              
91             =head1 AUTHOR
92              
93             Henry Van Styn <vanstyn@cpan.org>
94              
95             =head1 COPYRIGHT AND LICENSE
96              
97             This software is copyright (c) 2012-2015 by IntelliTree Solutions llc.
98              
99             This is free software; you can redistribute it and/or modify it under
100             the same terms as the Perl 5 programming language system itself.
101              
102             =cut