private function saveSummary(Deal $model) { $deal = isset($_POST['Deal']) ? $_POST['Deal'] : false; if ($deal) { $model->attributes = $deal; if ($model->save()) { Yii::app()->user->setFlash('success', 'Updated Successfully'); $model->setCategories(isset($deal['category']) ? array_keys($deal['category']) : []); foreach (Note::getTypes() as $noteType) { $this->saveNote($_POST, $noteType, $model); } return true; } } return false; }