Interchange6-Schema

 view release on metacpan or  search on metacpan

lib/Interchange6/Schema/Base/Attribute.pm  view on Meta::CPAN

}

=head2 update_attribute_value

Update base attribute value

    $base->update_attribute('hair_color', 'brown');

=cut

sub update_attribute_value {
    my ($self, $attr, $attr_value) = @_;
    my $base = $self->result_source->source_name;

    my ($attribute, $attribute_value) = $self->find_or_create_attribute($attr, $attr_value);

    my (undef, $base_attribute_value) = $self->find_base_attribute_value($attribute, $base);

    $base_attribute_value->update({attribute_values_id => $attribute_value->id});

    return $self;

lib/Interchange6/Schema/Component/Validation.pm  view on Meta::CPAN

    }
    return $self;
}

=head2 update

Overload update to call L</validate> before update is performed.

=cut

sub update {
    my ( $self, @args ) = @_;
    eval{ $self->validate };
    if ($@) {
        $self->result_source->schema->throw_exception($@);
    } 
    else {
        $self->next::method(@args);
    }
    return $self;
}

lib/Interchange6/Schema/Result/Product.pm  view on Meta::CPAN

    $self->next::method(@args);
    return $self;
}

=head2 update_price_modifiers

Called when L</price> is updated.

=cut

sub update_price_modifiers {
    my ( $self, $old_value, $new_value ) = @_;

    my $price_modifiers =
      $self->price_modifiers->search( { discount => { '!=' => undef } } );

    while ( my $result = $price_modifiers->next ) {
        $result->update(
            {
                price => sprintf( "%.2f",
                    $new_value - ( $new_value * $result->discount / 100 ) )

lib/Interchange6/Schema/Result/User.pm  view on Meta::CPAN

    $guard->commit;
    return $self;
}

=head2 update

Overloaded method. Check username using L</check_username> if supplied.

=cut

sub update {
    my ( $self, $upd ) = @_;

    my $username;

    # username may have been passed as arg or previously set

    if ( exists $upd->{username} ) {
        $upd->{username} = check_username($upd->{username});
    }

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.421 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )