Skip to content
flack edited this page Dec 8, 2016 · 7 revisions

Unless otherwise configured, Midgard automatically adds information like creation time, author, approval status and so on to every MgdSchema object and tracks them in dedicated DB columns. In PHP, this is available in the metadata property:

$article = new midcom_db_article($id);
$revisor = new midcom_db_person($article->metadata->revisor);
$revised = strftime('%x %X', $article->metadata->revised);
echo 'Article "' . $article->title . '" was last updated on ' . $revised . ' by ' . $revisor->name . "\n";

Default Metadata Fields

  • creator: GUID of the person who created the object
  • created: Creation time
  • revisor: GUID of the person who last updated the object
  • revised: Last update time
  • revision Revision number
  • locker: GUID of the person who locked the object
  • locked: lock time
  • approver: GUID of the person who approved the object
  • approved: Approval time
  • authors: GUIDs of the Persons who edited the object
  • owner: GUID of the person who owns the object (relevant for ACL)
  • schedulestart: Scheduled start time
  • scheduleend: Scheduled start time
  • hidden: Is the object visible or not
  • navnoentry: Should the object be shown in Navigation
  • size: Object size in Bytes
  • published: Publication time
  • score: Order for sorting
  • imported: Time of import (when using replication)
  • exported: Time of export (when using replication)
  • deleted: Is the object deleted
  • islocked: Is the object locked
  • isapproved: Is the object approved

Most of these fields are read-only, they are set automatically by the system

Clone this wiki locally