Smutty


Smutty.Smutty_Model_Transaction

Class Smutty_Model_Transaction

Smutty_Object
|
+--Smutty_Model_Transaction

public class Smutty_Model_Transaction
extends Smutty_Object

this class allows models to be grouped together into a "transaction", which means you can deal with them as a single unit rather than saving/validating them all individually.

/


Field Summary
mixed

$errors

any errors found */

mixed

$models

the transactions models */

Constructor Summary

Smutty_Model_Transaction()

constructor

Method Summary
nothing

add(Smutty_Model model)

adds a model to the transaction

array

getErrors()

returns any errors found when trying to save the transaction

boolean

isValid()

checks if all the models in the transaction are valid

boolean

save()

checks all the models in the transaction for validity before saving them.

Field Detail

errors

public mixed $errors

any errors found */


models

public mixed $models

the transactions models */


Constructor Detail

Smutty_Model_Transaction

public Smutty_Model_Transaction()

constructor


Method Detail

add

public nothing add(Smutty_Model model)

adds a model to the transaction

Parameters:
model - model to add
Go to code

getErrors

public array getErrors()

returns any errors found when trying to save the transaction

Returns:
array of error strings
Go to code

isValid

public boolean isValid()

checks if all the models in the transaction are valid

Returns:
transaction validity
Go to code

save

public boolean save()

checks all the models in the transaction for validity before saving them.

Returns:
if transaction saved
Go to code

Smutty