public function getTablePk($tableName) {
        $details = $this->getTableColumns($tableName);
        $pk = [];
        foreach ($details as $column) {
            if ($column['Key'] == 'PRI') {
                $pk[] =  $column['Field'];
            }
        }
        if (1 == count($pk)){
            return $pk[0];
        } elseif (count($pk)) {
            return $pk;
        }
        return null;
    }
public function getTablePk($tableName) {
        $details = $this->getTableColumns($tableName);
        $pk = [];
        foreach ($details as $column) {
            if ($column['Key'] == 'PRI') {
                $pk[] =  $column['Field'];
            }
        }
        if (1 == count($pk)){
            return $pk[0];
        } elseif (count($pk)) {
            return $pk;
        }
        return null;
    }
public function getTablePk ( $ tableName ) { $ details = $ this -> getTableColumns ( $ tableName ) ; $ pk = [ ] ; foreach ( $ details as $ column ) { if ( $ column [ 'Key' ] == 'PRI' ) { $ pk [ ] = $ column [ 'Field' ] ; } } if ( 1 == count ( $ pk ) ) { return $ pk [ 0 ] ; } elseif ( count ( $ pk ) ) { return $ pk ; } return null ; }
Get column used as primary key.
@param string $tableName
@return string|string[]|null
Get column used as primary key .