protected function _getPrimaryKeysOfAffectedRows(Garp_Model_Db $model, $where) {
        if ($draftableObserver = $model->getObserver('Draftable')) {
            // Unregister so it doesn't screw up the upcoming fetch call
            $model->unregisterObserver($draftableObserver);
        }

        $pkExtractor = new Garp_Db_PrimaryKeyExtractor($model, $where);
        $pks = $pkExtractor->extract();
        if (count($pks)) {
            return array($pks);
        }
        $rows = $model->fetchAll($where);
        $pks = array();
        foreach ($rows as $row) {
            if (!$row->isConnected()) {
                $row->setTable($model);
            }
            $pks[] = (array)$row->getPrimaryKey();
        }
        if ($draftableObserver) {
            $model->registerObserver($draftableObserver);
        }
        return $pks;
    }