Form-Processor-Model-RDBO
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Form/Processor/Model/RDBO.pm view on Meta::CPAN
}
=head2 update_from_form
Makes form validation and returns the filled RDBO item, filled by update_model.
It does not save the current item automatically. You should do this in your
code, after the call update_from_form.
=cut
sub update_from_form {
my ( $self, $params ) = @_;
return unless $self->validate( $params );
return $self->update_model( $params );
}
=head2 update_model
Returns the new RDBO item, filled with passed form params. It does not save any
data to the database, just creates and fills new RDBO object.
=cut
sub update_model {
my ( $self, $params ) = @_;
my $item = $self->item;
my $class = ref( $item ) || $self->object_class;
my %fields = map { $_->name, $_ } grep { !$_->noupdate } $self->fields;
$item = $class->new() unless $item;
while ( my ( $name, $field ) = each %fields ) {
if ( $item->can( $name ) ) {
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.225 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )