public static function getPrimaryKeyOfTable($tableName)
    {
        $schema = DB::getDoctrineSchemaManager();
        $column = $schema->listTableDetails($tableName)->getPrimaryKey();

        return $column ? $column->getColumns()[0] : '';
    }
public static function getPrimaryKeyOfTable($tableName)
    {
        $schema = DB::getDoctrineSchemaManager();
        $column = $schema->listTableDetails($tableName)->getPrimaryKey();

        return $column ? $column->getColumns()[0] : '';
    }
public static function getPrimaryKeyOfTable ( $ tableName ) { $ schema = DB :: getDoctrineSchemaManager ( ) ; $ column = $ schema -> listTableDetails ( $ tableName ) -> getPrimaryKey ( ) ; return $ column ? $ column -> getColumns ( ) [ 0 ] : '' ; }
Get primary key of given table.

@param string $tableName

@return string|null The column name of the (simple) primary key
Get primary key of given table .