public function getPrimaryKey()
    {
        if ($this->primary_key === null) {
            $pks = $this->getPrimaryKeys();
            if (count($pks) > 1) {
                throw new Exception\MultiplePrimaryKeysFoundException(__METHOD__ . ": Error getting unique primary key on table, multiple found on table " . $this->prefixed_table);
            }
            $this->primary_key = $pks[0];
        }
        return $this->primary_key;
    }
public function getPrimaryKey()
    {
        if ($this->primary_key === null) {
            $pks = $this->getPrimaryKeys();
            if (count($pks) > 1) {
                throw new Exception\MultiplePrimaryKeysFoundException(__METHOD__ . ": Error getting unique primary key on table, multiple found on table " . $this->prefixed_table);
            }
            $this->primary_key = $pks[0];
        }
        return $this->primary_key;
    }
public function getPrimaryKey ( ) { if ( $ this -> primary_key === null ) { $ pks = $ this -> getPrimaryKeys ( ) ; if ( count ( $ pks ) > 1 ) { throw new Exception \ MultiplePrimaryKeysFoundException ( __METHOD__ . ": Error getting unique primary key on table, multiple found on table " . $ this -> prefixed_table ) ; } $ this -> primary_key = $ pks [ 0 ] ; } return $ this -> primary_key ; }
Return primary key, if multiple primary keys found will
throw an exception

@throws Exception\PrimaryKeyNotFoundException when no pk found
@throws Exception\MultiplePrimaryKeysFoundException when multiple primary keys found
@throws Exception\RuntimeException when it cannot determine primary key on table

@return int|string
Return primary key if multiple primary keys found will throw an exception