public function update(array $preferences, $user = null)
    {
        foreach ($preferences as $key => $value) {
            $this->getPreferenceOrFail($key);
        }

        $this->backend->setPreferences($preferences, $this->getUserId($user));
    }