original_string: private static function generatePrimaryKey(array $pk, array $columns)
      {
          if (empty($pk)) {
              return '';
          }
          // Composite primary keys
          if (2 <= count($pk)) {
              $compositePk = implode(', ', $pk);
              return "    'PRIMARY KEY ($compositePk)',\n";
          }
          // Primary key not an auto-increment
          $flag = false;
          foreach ($columns as $column) {
              if ($column->autoIncrement) {
                  $flag = true;
              }
          }
          if (false === $flag) {
              return sprintf("    'PRIMARY KEY (%s)',\n", $pk[0]);
          }
          return '';
      }
code: private static function generatePrimaryKey(array $pk, array $columns)
      {
          if (empty($pk)) {
              return '';
          }
          // Composite primary keys
          if (2 <= count($pk)) {
              $compositePk = implode(', ', $pk);
              return "    'PRIMARY KEY ($compositePk)',\n";
          }
          // Primary key not an auto-increment
          $flag = false;
          foreach ($columns as $column) {
              if ($column->autoIncrement) {
                  $flag = true;
              }
          }
          if (false === $flag) {
              return sprintf("    'PRIMARY KEY (%s)',\n", $pk[0]);
          }
          return '';
      }
code_tokens: private static function generatePrimaryKey ( array $ pk , array $ columns ) { if ( empty ( $ pk ) ) { return '' ; } // Composite primary keys if ( 2 <= count ( $ pk ) ) { $ compositePk = implode ( ', ' , $ pk ) ; return "    'PRIMARY KEY ($compositePk)',\n" ; } // Primary key not an auto-increment $ flag = false ; foreach ( $ columns as $ column ) { if ( $ column -> autoIncrement ) { $ flag = true ; } } if ( false === $ flag ) { return sprintf ( "    'PRIMARY KEY (%s)',\n" , $ pk [ 0 ] ) ; } return '' ; }
docstring: Returns the primary key definition.
  @param array $pk
  @param array $columns
  @return string the primary key definition
docstring_tokens: Returns the primary key definition .