Open Source Content Management Framework

Article Object Definition

This section describes the structure of Midgard's article objects as returned by mgd_get_article. Midgard's list functions (such as mgd_list_topic_articles) return Fetchables only, no real MidgardArticle objects.

Most object members map directly to the record fields described before. Some of them are read-only and can only be changed using a special function (see below), others are derived from one or more record fields and only provided for your convenience (e.g., startdate or enddate).

The functions listed within the object definition are the object methods that are available for the object. Usage information about those methods and common information about Midgard objects can be found in the Objects and Methods chapter.

// MidgardArticle: Object Prototype for full instances  

class MidgardArticle {  

  // Basic record data (read/write)  
  var $id;  
  var $up;  
  var $topic;  
  var $name;  
  var $title;  
  var $abstract;  
  var $content;  
  var $author;  
  var $extra1;  
  var $extra2;  
  var $extra3;  
  var $score;  
  var $type;  
  var $url;  
  var $icon;  
  var $view;  
  var $print;  
  var $calstart;            // Date format "dd.mm.yyyy"  
  var $caldays;             // Integer  
  var $approved;  
  var $locked;  

  // Meta data, set internally with every update (read-only)  
  var $created;  
  var $creator;  
  var $revised;  
  var $revisor;  
  var $revision;  
  var $approver;  
  var $locker;  

  // Derived fields for convenience (read-only)  
  var $calstop;             // "dd.mm.yyyy" date string of $calstart+$caldays  
  var $startdate;           // UNIX timestamp of $calstart  
  var $enddate;             // UNIX timestamp of $calstart+$caldays  
  var $date;  
  var $adate;               // Date format "D b. Y" (ex. 6th Aug 2000)  
  var $aldate;              // Date format "D M Y" (ex. 6th August 2000)  
  var $calendar;  
  var $acalendar;           // Date format "D b. Y"  
  var $alcalendar;          // Date format "D M Y"  

  var $sitegroup;  
  var $lang;                // if compiled with multilang features  

  // Public methods  

  function create();  
  function create_content();// if compiled with multilang features  
  function update();  
  function update_content();// if compiled with multilang features  
  function delete();  
  function delete_content();// if compiled with multilang features  

  function setscore();  

  function settype();  

  function createattachment();  
  function updateattachment();  
  function deleteattachment();  
  function getattachment();  
  function listattachment();  
  function openattachment();  
  function serveattachment();  

  function parameter();  
  function listparameters();  
  function searchparameters();  

  function setsitegroup();  
  function getsitegroup();  

}
Designed by Nemein, hosted by Kafit