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;
    }