protected function getPKValue($tablename, array $row, $quick = false) {
        if ($quick && isset($row[$tablename.'ID'])) {
            return [$tablename.'ID' => $row[$tablename.'ID']];
        }

        $tdef = $this->getTableDef($tablename);
        if (isset($tdef['indexes'][Db::INDEX_PK]['columns'])) {
            $pkColumns = array_flip($tdef['indexes'][Db::INDEX_PK]['columns']);
            $cols = array_intersect_key($row, $pkColumns);
            if (count($cols) === count($pkColumns)) {
                return $cols;
            }
        }

        return null;
    }
protected function getPKValue($tablename, array $row, $quick = false) {
        if ($quick && isset($row[$tablename.'ID'])) {
            return [$tablename.'ID' => $row[$tablename.'ID']];
        }

        $tdef = $this->getTableDef($tablename);
        if (isset($tdef['indexes'][Db::INDEX_PK]['columns'])) {
            $pkColumns = array_flip($tdef['indexes'][Db::INDEX_PK]['columns']);
            $cols = array_intersect_key($row, $pkColumns);
            if (count($cols) === count($pkColumns)) {
                return $cols;
            }
        }

        return null;
    }
protected function getPKValue ( $ tablename , array $ row , $ quick = false ) { if ( $ quick && isset ( $ row [ $ tablename . 'ID' ] ) ) { return [ $ tablename . 'ID' => $ row [ $ tablename . 'ID' ] ] ; } $ tdef = $ this -> getTableDef ( $ tablename ) ; if ( isset ( $ tdef [ 'indexes' ] [ Db :: INDEX_PK ] [ 'columns' ] ) ) { $ pkColumns = array_flip ( $ tdef [ 'indexes' ] [ Db :: INDEX_PK ] [ 'columns' ] ) ; $ cols = array_intersect_key ( $ row , $ pkColumns ) ; if ( count ( $ cols ) === count ( $ pkColumns ) ) { return $ cols ; } } return null ; }
Get the primary or secondary keys from the given rows.

@param string $tablename The name of the table.
@param array $row The row to examine.
@param bool $quick Whether or not to quickly look for <tablename>ID for the primary key.
@return array|null Returns the primary keys and values from {@link $rows} or null if the primary key isn't found.
Get the primary or secondary keys from the given rows .