Пример #1
0
 /**
  * @param CModel $model
  * @param array $splitAttributes
  * @param array $models
  * @return bool
  */
 public static function saveSplitModels(CModel $model, array $splitAttributes, &$models = [])
 {
     $isAllModelsSaved = false;
     $model->attachBehavior(__CLASS__, 'application.models.' . __CLASS__);
     $model->setSplitAttributes($model->getSplitAttributes());
     $models = $model->getSplitModels();
     if ($model->validateModels($models)) {
         $isAllModelsSaved = $model->saveModels($models, false, null, true);
     }
     return $isAllModelsSaved;
 }