original_string: protected function prepareModelsToSave($model, $saveData)
      {
          $this->modelsToSave = [];
          $this->setModelAttributes($model, $saveData);
          $this->modelsToSave = array_reverse($this->modelsToSave);
          return $this->modelsToSave;
      }
code: protected function prepareModelsToSave($model, $saveData)
      {
          $this->modelsToSave = [];
          $this->setModelAttributes($model, $saveData);
          $this->modelsToSave = array_reverse($this->modelsToSave);
          return $this->modelsToSave;
      }
code_tokens: protected function prepareModelsToSave ( $ model , $ saveData ) { $ this -> modelsToSave = [ ] ; $ this -> setModelAttributes ( $ model , $ saveData ) ; $ this -> modelsToSave = array_reverse ( $ this -> modelsToSave ) ; return $ this -> modelsToSave ; }
docstring: Takes a model and fills it with data from a multidimensional array.
  If an attribute is found to be a relationship, that relationship
  is also filled.
  
  $modelsToSave = $this->prepareModelsToSave($model, [...]);
  
  foreach ($modelsToSave as $modelToSave) {
  $modelToSave->save();
  }
  
  @param \October\Rain\Database\Model $model Model to fill.
  @param array $saveData Attribute values to fill model.
  @return array The collection of models to save.
docstring_tokens: Takes a model and fills it with data from a multidimensional array . If an attribute is found to be a relationship that relationship is also filled .