original_string: private function hasUniqueConstraint(ClassMetadata $mapping, array $columns)
      {
          if (!array_diff($mapping->getIdentifierColumnNames(), $columns)) {
              return true;
          }
  
          if (!isset($mapping->table['uniqueConstraints'])) {
              return false;
          }
  
          foreach ($mapping->table['uniqueConstraints'] as $constraint) {
              if (!array_diff($constraint['columns'], $columns)) {
                  return true;
              }
          }
  
          return false;
      }
code: private function hasUniqueConstraint(ClassMetadata $mapping, array $columns)
      {
          if (!array_diff($mapping->getIdentifierColumnNames(), $columns)) {
              return true;
          }
  
          if (!isset($mapping->table['uniqueConstraints'])) {
              return false;
          }
  
          foreach ($mapping->table['uniqueConstraints'] as $constraint) {
              if (!array_diff($constraint['columns'], $columns)) {
                  return true;
              }
          }
  
          return false;
      }
code_tokens: private function hasUniqueConstraint ( ClassMetadata $ mapping , array $ columns ) { if ( ! array_diff ( $ mapping -> getIdentifierColumnNames ( ) , $ columns ) ) { return true ; } if ( ! isset ( $ mapping -> table [ 'uniqueConstraints' ] ) ) { return false ; } foreach ( $ mapping -> table [ 'uniqueConstraints' ] as $ constraint ) { if ( ! array_diff ( $ constraint [ 'columns' ] , $ columns ) ) { return true ; } } return false ; }
docstring: Check if an unique constraint has been defined
  
  @param ClassMetadata $mapping
  @param array $columns
  @return bool
docstring_tokens: Check if an unique constraint has been defined