1 package Reaction::InterfaceModel::Action::DBIC::Result::Update;
4 use namespace::clean -except => [ qw(meta) ];
6 extends 'Reaction::InterfaceModel::Action::DBIC::Result';
7 with 'Reaction::InterfaceModel::Action::DBIC::Role::CheckUniques';
11 my $tm = $self->target_model;
12 foreach my $attr ($self->parameter_attributes) {
13 my $writer = $attr->get_write_method;
14 my $name = $attr->name;
15 my $tm_attr = $tm->meta->find_attribute_by_name($name);
16 next unless ref $tm_attr;
17 my $tm_reader = $tm_attr->get_read_method;
18 $self->$writer($tm->$tm_reader) if defined($tm->$tm_reader);
24 my $args = $self->parameter_hashref;
25 my $model = $self->target_model;
26 foreach my $name (keys %$args) {
27 my $tm_attr = $model->meta->find_attribute_by_name($name);
28 next unless ref $tm_attr;
29 my $tm_writer = $tm_attr->get_write_method;
30 $model->$tm_writer($args->{$name});
36 __PACKAGE__->meta->make_immutable;
44 Reaction::InterfaceModel::Action::DBIC::Result::Update
48 Update the target model and sync the Action's parameter attributes to
51 C<Update> is a subclass of
52 L<Action::DBIC::Result|Reaction::InterfaceModel::Action::DBIC::Result> that cponsumes
53 L<Role::CheckUniques|'Reaction::InterfaceModel::Action::DBIC::Role::CheckUniques>
57 Sync the values from the target model's parameter attributes to the action's
62 Sync the target model's parameter attributes to the values returned by
63 C<parameter_hashref>, call C<update> and return the C<target_model>.
67 L<Create|Reaction::InterfaceModel::Action::DBIC::ResultSet::Create>,
68 L<DeleteAll|Reaction::InterfaceModel::Action::DBIC::ResultSet::DeleteAll>,
69 L<Delete|Reaction::InterfaceModel::Action::DBIC::Result::Delete>,
73 See L<Reaction::Class> for authors.
77 See L<Reaction::Class> for the license.