From b6206a3e23a9a933a8981c587e15aa268f5fb331 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 21 Jun 2019 16:47:55 +0100 Subject: [PATCH] Bug 21761: Call set + store as update Signed-off-by: Jonathan Druart Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize --- Koha/Object.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Koha/Object.pm b/Koha/Object.pm index a92e870c40..ce4c231591 100644 --- a/Koha/Object.pm +++ b/Koha/Object.pm @@ -191,6 +191,17 @@ sub store { } } +=head3 $object->update(); + +A shortcut for set + store in one call. + +=cut + +sub update { + my ($self, $values) = @_; + return $self->set($values)->store(); +} + =head3 $object->delete(); Removes the object from storage. @@ -491,7 +502,7 @@ sub AUTOLOAD { } } - my @known_methods = qw( is_changed id in_storage get_column discard_changes update make_column_dirty ); + my @known_methods = qw( is_changed id in_storage get_column discard_changes make_column_dirty ); Koha::Exceptions::Object::MethodNotCoveredByTests->throw( error => sprintf("The method %s->%s is not covered by tests!", ref($self), $method), -- 2.20.1