final public function getLastPk($table = null)
    {
        if ($table === null) {
            $this->validateShortcutData();
            $table = static::getTableName();
        }

        return $this->db->select()
                        ->max($this->getPk())
                        ->from($table)
                        ->queryScalar();
    }