This should be what you want. A couple of stubs and fake names shown to give you ideas for how to fill in the blanks. :P The new helper component–
package MyDB::Audit; use parent qw( DBIx::Class ); use strict; use warnings; sub update { my $self = shift; return $self->next::method(@_) if some_reason_not_to_log_this_one($self->table); my %data = $self->get_dirty_columns; _log_changed_data(\%data); $self->next::method(@_); } 1;
One of your current result source classes–
package MyDB::Result::Dingus; use strict; use warnings; use parent "DBIx::Class::Core"; __PACKAGE__->load_components("+MyDB::Audit"); __PACKAGE__->table("Dingus"); __PACKAGE__->add_columns( ...et cetera... );
Have fun. :P
In reply to Re: Overriding method in multiple DBIx::Class child classes
by Your Mother
in thread Overriding method in multiple DBIx::Class child classes
by MattLG
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |