original_string: protected function isManyToMany($table, $checkForeignKey = true)
      {
          $describe = $this->dataBase->describeTable($table);
  
          $count = 0;
          foreach ($describe as $field) {
              if (count($describe) < 3) {
                  $type = $this->parseType($field->Type);
                  if ($type['type'] == 'int' && $field->Key == 'PRI') {
                      // should be a foreign key
                      if ($checkForeignKey && $this->isForeignKey($table, $field->Field)) {
                          $count++;
                      }
                      if (!$checkForeignKey) {
                          $count++;
                      }
                  }
              }
          }
          if ($count == 2) {
              return true;
          }
  
          return false;
      }
code: protected function isManyToMany($table, $checkForeignKey = true)
      {
          $describe = $this->dataBase->describeTable($table);
  
          $count = 0;
          foreach ($describe as $field) {
              if (count($describe) < 3) {
                  $type = $this->parseType($field->Type);
                  if ($type['type'] == 'int' && $field->Key == 'PRI') {
                      // should be a foreign key
                      if ($checkForeignKey && $this->isForeignKey($table, $field->Field)) {
                          $count++;
                      }
                      if (!$checkForeignKey) {
                          $count++;
                      }
                  }
              }
          }
          if ($count == 2) {
              return true;
          }
  
          return false;
      }
code_tokens: protected function isManyToMany ( $ table , $ checkForeignKey = true ) { $ describe = $ this -> dataBase -> describeTable ( $ table ) ; $ count = 0 ; foreach ( $ describe as $ field ) { if ( count ( $ describe ) < 3 ) { $ type = $ this -> parseType ( $ field -> Type ) ; if ( $ type [ 'type' ] == 'int' && $ field -> Key == 'PRI' ) { // should be a foreign key if ( $ checkForeignKey && $ this -> isForeignKey ( $ table , $ field -> Field ) ) { $ count ++ ; } if ( ! $ checkForeignKey ) { $ count ++ ; } } } } if ( $ count == 2 ) { return true ; } return false ; }
docstring: Detect many to many tables.
  
  @param $table
  @param bool $checkForeignKey
  
  @return bool
docstring_tokens: Detect many to many tables .