diff options
Diffstat (limited to 'Digitigrade/Model.php')
| -rw-r--r-- | Digitigrade/Model.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Digitigrade/Model.php b/Digitigrade/Model.php index 9ce759a..14d025d 100644 --- a/Digitigrade/Model.php +++ b/Digitigrade/Model.php @@ -139,6 +139,13 @@ abstract class Model { } /** + * Saves fields of the model that couldn't be saved automatically + * @return void + */ + protected function dehydrate() { + } + + /** * Checks that all fields of the model are valid and allowed * @return bool true if the model is valid, false otherwise */ @@ -308,6 +315,9 @@ abstract class Model { } } + // anything else that needs saving right now + $this->dehydrate(); + $this->saved = true; } |
