From 41e796c52aa693d13636b54efe15705eaec27f3f Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 20 Sep 2014 14:49:31 +0200 Subject: Models refactoring/improvements --- app/Model/SubTask.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'app/Model/SubTask.php') diff --git a/app/Model/SubTask.php b/app/Model/SubTask.php index 400c79f4..0126030a 100644 --- a/app/Model/SubTask.php +++ b/app/Model/SubTask.php @@ -128,17 +128,8 @@ class SubTask extends Base */ public function prepare(array &$values) { - if (isset($values['another_subtask'])) { - unset($values['another_subtask']); - } - - if (isset($values['time_estimated']) && empty($values['time_estimated'])) { - $values['time_estimated'] = 0; - } - - if (isset($values['time_spent']) && empty($values['time_spent'])) { - $values['time_spent'] = 0; - } + $this->removeFields($values, array('another_subtask')); + $this->resetFields($values, array('time_estimated', 'time_spent')); } /** -- cgit v1.2.3