| 1 | package DBIx::Class::AuditAny::Role::Collector; | ||
| 2 | 14 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 14 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | # ABSTRACT: Role for all Collector classes | ||
| 6 | |||
| 7 | 14 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 14 | ▶ | use MooX::Types::MooseLike::Base qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 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 | 14 | 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 | 14 | 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 | 2 | ▶ | has 'writes_bound_schema_sources', is => 'ro', isa => ArrayRef[Str], lazy => 1, default => sub {[]}; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 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 | 0 | ▶ | sub has_full_row_stored { |
|
Subroutine
has_full_row_stored: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 59 | 0 | 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 | 14 | 1; | |
| 68 | |||
| 69 | __END__ | ||