XVI. Preference Reference

Midgard used Preference records to attach preferences to person records. They are now deprecated, as the same thing can be achieved with Parameter records.

1. Preference Record Definition

A preference record contains information about a preference and the person record it is attached to.

Fields of a preference record

id

The id of the preference record.

uid

The id of the person record the preference is attached to.

domain

The domain the preference is in. A domain is an organisational unit used to organize large sets of preferences into logical groups.

name

The name of the preference.

value

The value of the preference.

sitegroup

The id of the sitegroup the preference belongs to.

2. Preference Object Definition

This section describes the contents of a preference object. Most object parameters map directly to the record fields described above.

The functions listed within the object definition are the object methods that are available for the object. Usage information about those methods can be found in Object Methods.

/* Preference Object Prototype */

Class preference {

  var $N;     # Only with mgd_list_XXX functions.
  var $id;
  var $uid;
  var $domain;
  var $name;
  var $value;
  var $sitegroup;

  function fetch();    # Only with mgd_list_XXX functions.

  function create();
  function update();
  function delete();

  function createattachment();
  function updateattachment();
  function deleteattachment();
  function getattachment();
  function listattahcments();
  function openattachment();
  function serveattachement();

  function listparameters();
  function parameter();
  function searchparameters();
 
  function getsitegroup();
  function setsitegroup();

}
Table of Contents
mgd_create_preference — Create a preference record
mgd_delete_preference — Delete a preference record
mgd_get_preference — Get a preference
mgd_list_preferences — List preferences
mgd_update_preference — Update a preference