private function getIdentifierValues($model)
    {
        if (!$model instanceof $this->class) {
            return array();
        }

        if (1 === count($this->identifier) && current($this->identifier) instanceof \ColumnMap) {
            $phpName = current($this->identifier)->getPhpName();

            if (method_exists($model, 'get'.$phpName)) {
                return array($model->{'get'.$phpName}());
            }
        }

        if ($model instanceof \Persistent) {
            return array($model->getPrimaryKey());
        }

        // readonly="true" models do not implement \Persistent.
        if ($model instanceof \BaseObject && method_exists($model, 'getPrimaryKey')) {
            return array($model->getPrimaryKey());
        }

        if (!method_exists($model, 'getPrimaryKeys')) {
            return array();
        }

        return $model->getPrimaryKeys();
    }