1 package # hide from PAUSE
2 DBIx::Class::CDBICompat::Triggers;
7 use base 'DBIx::Class';
14 return $self->create(@_) unless ref $self;
16 $self->call_trigger('before_create');
17 $self->next::method(@_);
18 $self->call_trigger('after_create');
24 $self->call_trigger('before_update');
25 my @to_update = keys %{$self->{_dirty_columns} || {}};
26 return -1 unless @to_update;
27 $self->next::method(@_);
28 $self->call_trigger('after_update');
34 $self->call_trigger('before_delete') if ref $self;
35 $self->next::method(@_);
36 $self->call_trigger('after_delete') if ref $self;
41 my ($self, $column, $value, @rest) = @_;
42 my $vals = { $column => $value };
43 $self->call_trigger("before_set_${column}", $value, $vals);
44 return $self->next::method($column, $vals->{$column});