Feature #4167

Implement an update() method for the base repository

Added by Robert Lemke almost 6 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2009-08-06
Priority:Must have Due date:
Assigned To:Robert Lemke % Done:

100%

Category:Persistence
Target version:TYPO3 Flow Base Distribution - 1.0 alpha 3
PHP Version: Complexity:
Has patch:

Description

The base repository (\F3\FLOW3\Persistence\Repository) should provide an update() method which allows for convenient updates of an existing object.

The update method expects one argument which is a not-yet persisted clone of the original object. The fact that it is a clone of the original is important because only then it has the same UUID like the original object. If the object is not a clone, you must use replace() instead.

Calling update() will check the uuid of the given object, fetch the currently persisted object with the same uuid, will disconnect the existing object from the repository and persistence framework and connect the new object instead.

Associated revisions

Revision 10ec9ad8
Added by Robert Lemke almost 6 years ago

[+FEATURE] FLOW3 (MVC): It is now possible to disable validation temporarily for single controller arguments. This is necessary in situations where a knowingly incomplete / invalid argument needs to be passed to an action, for example an edit action. Validation can be disabled either by calling the disableValidation() method on the argument object or by adding a @dontvalidate $argumentName annotation to an action method. Resolves #4166
[+TASK] FLOW3 (Documentation): Documented the new @dontvalidate annotation.
[+FEATURE] FLOW3 (Package): The package manager's command line controller now returns a friendly error message on trying to activate or deactivate an already active or inactive package. Earlier it just threw an unpolished exception.
[+FEATURE] FLOW3 (Persistence): Implemented an update() method for the base repository which allows for conveniently updating existing objects. update() only expects one argument which must be a clone of the object to replace, already containing the modifications. The object passed to update() must internally contain the same uuid like the object to be updated (ie. replaced). In fact this new update() method is basically a more convenient way to call replace(). Resolves #4167
[+BUGFIX] FLOW3 (MVC): A @validate annotation placed in an action method's comment replaced existing rules instead of adding them to a common conjunction validator. By this it was possible to override any validation rule with a simple @validate $foo Raw annotation. Fixes #4168

History

#1 Updated by Robert Lemke almost 6 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r2989.

Also available in: Atom PDF