Para::Frame::Change - DB Change class
This is an object for collecting information about changes.
The idea is to let various methods add messages about changes or errors to objects. If everything is okey, display all the messages. If one of the messages returns an error, only display the error and do a rollback so that no changes is done to the DB.
Could be used in combination with methods in Para::Frame::DBIx.
$changes->reset()
Resets the change object. Like creating a new object, but keeps the existing one.
Returns the now empty object.
$changes->rollback()
$changes->success( $message )
Adds a success message. Increments the changes
counter.
Returns true.
$changes->note( $message )
Adds a note, not counting as success or failure.
Returns true.
$changes->fail( $message )
Adds a failure message. Increments the errors
counter.
Returns false.
$changes->changes
Returns the number of successful changes
.
$changes->errors
Returns the number of errors
$changes->message
Returns the messages from the successful changes. Each message separated by a newline.
$changes->errmsg
Returns teh error messages. Each message separated by a newline.
$changes->queue_clear_params( @list )
Will call <Para::Frame::Utils/clear_params> before rendering the resulting page, unless we got a rollback.
Called just before $req->response->render_output
$changes->report $changes->report( $errtype )
Puts the /message in a Para::Frame::Result/message.
If there is an /errmsg, Throws an exception with that message of
type $errtype
. The default errtype is validation
.