|  |  | @ -27,6 +27,8 @@ class SaveRelationsBehavior extends Behavior | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public $relations = []; |  |  |  |     public $relations = []; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public $useFormName = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     private $_relations = []; |  |  |  |     private $_relations = []; | 
			
		
	
		
		
			
				
					
					|  |  |  |     private $_oldRelationValue = []; // Store initial relations value |  |  |  |     private $_oldRelationValue = []; // Store initial relations value | 
			
		
	
		
		
			
				
					
					|  |  |  |     private $_newRelationValue = []; // Store update relations value |  |  |  |     private $_newRelationValue = []; // Store update relations value | 
			
		
	
	
		
		
			
				
					|  |  | @ -34,7 +36,6 @@ class SaveRelationsBehavior extends Behavior | 
			
		
	
		
		
			
				
					
					|  |  |  |     private $_relationsSaveStarted = false; |  |  |  |     private $_relationsSaveStarted = false; | 
			
		
	
		
		
			
				
					
					|  |  |  |     private $_transaction; |  |  |  |     private $_transaction; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     private $_relationsScenario = []; |  |  |  |     private $_relationsScenario = []; | 
			
		
	
		
		
			
				
					
					|  |  |  |     private $_relationsExtraColumns = []; |  |  |  |     private $_relationsExtraColumns = []; | 
			
		
	
		
		
			
				
					
					|  |  |  |     private $_relationsCascadeDelete = []; |  |  |  |     private $_relationsCascadeDelete = []; | 
			
		
	
	
		
		
			
				
					|  |  | @ -736,9 +737,9 @@ class SaveRelationsBehavior extends Behavior | 
			
		
	
		
		
			
				
					
					|  |  |  |             $modelClass = $relation->modelClass; |  |  |  |             $modelClass = $relation->modelClass; | 
			
		
	
		
		
			
				
					
					|  |  |  |             /** @var ActiveQuery $relationalModel */ |  |  |  |             /** @var ActiveQuery $relationalModel */ | 
			
		
	
		
		
			
				
					
					|  |  |  |             $relationalModel = new $modelClass; |  |  |  |             $relationalModel = new $modelClass; | 
			
		
	
		
		
			
				
					
					|  |  |  |             $formName = $relationalModel->formName(); |  |  |  |             $keyName = $this->useFormName ? $relationalModel->formName() : $relationName; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             if (array_key_exists($formName, $data)) { |  |  |  |             if (array_key_exists($keyName, $data)) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 $owner->{$relationName} = $data[$formName]; |  |  |  |                 $owner->{$relationName} = $data[$keyName]; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |