File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,28 @@ If you need to require two fields to be individually unique (e.g. a unique
272272``email `` and a unique ``username ``), you use two ``UniqueEntity `` entries,
273273each with a single field.
274274
275+ ``identifierFieldNames ``
276+ ~~~~~~~~~~ 
277+ 
278+ **type **: ``array ``
279+ 
280+ When applying the constraint to a non-entity class, this allows you to specify
281+ which field(s), on the object being validated, should be used to determine
282+ whether the object being validated is the same as an existing entity found
283+ with matching field value(s).
284+ 
285+ If the value(s) found in the object being validated's ``identifierFieldNames ``
286+ fields match the itentifiers of the object found in the databased, then that
287+ match is permitted.  If the identifiers to not match, then the found record
288+ will cause the valudation to fail.
289+ 
290+ .. warning ::
291+ 
292+     The array of values given should be the same as the identifier fields on
293+     the entity class, otherwise a
294+     ``\Symfony\Component\Validator\Exception\ConstraintDefinitionException ``
295+     will be thrown during validation.
296+ 
275297.. include :: /reference/constraints/_groups-option.rst.inc 
276298
277299``ignoreNull ``
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments