| @@ 306-310 (lines=5) @@ | ||
| 303 | if( $key !== 0 ) |
|
| 304 | $model->setPrimaryKey($primaryModel->getPrimaryKey()); |
|
| 305 | ||
| 306 | if( !$model->save(false) ) |
|
| 307 | {
|
|
| 308 | Yii::app()->db->currentTransaction->rollback(); |
|
| 309 | throw new CHttpException(500, 'Can`t save '.get_class($model).' model'); |
|
| 310 | } |
|
| 311 | } |
|
| 312 | ||
| 313 | if( $extendedSave ) |
|
| @@ 368-372 (lines=5) @@ | ||
| 365 | $model->$foreignKey = $this->model->getPrimaryKey(); |
|
| 366 | } |
|
| 367 | ||
| 368 | if( !$model->save(false) ) |
|
| 369 | {
|
|
| 370 | Yii::app()->db->currentTransaction->rollback(); |
|
| 371 | throw new CHttpException(500, 'Can`t save '.get_class($this->model).' model'); |
|
| 372 | } |
|
| 373 | ||
| 374 | $this->saveFiles($model); |
|
| 375 | } |
|