Event::toXml - jcobban/Genealogy GitHub Wiki

$event->toXml($top, $print, $options)

Up: class Event

This method creates an Extensible Markup Language (XML) document. This document contains a tag for each field in the associated database record whose name is the name of the field, and which encloses the textual value of the field. This is used by many PHP scripts, in particular those that permit Javascript to use AJAX to retrieve the contents of a database record for dynamic display to the user. The function returns the generated XML document as a string.

parameter description
$top A string containing the the tag name to use for the root XML tag of the document. If this is not a string or is an empty string it is replaced by the class name in lower case.
$print If this is omitted or is true the XML document is also sent to standard output. For compatibility with classes which support an associative array of settings this can also be specified as array('print' => true/false)
$options This contains a bit mask which is used by derived classes and is present here only because of the requirement that the signature of overloaded functions in derived classes must match the signature of the base implementation.

This method is customized to interpret the following fields:

fieldname display as
eventd only displayed if it is not private for the current user, plus a human-readable date
eventsd only displayed if it is not private for the current user
idlrevent plus the location or temple name associated with the field
idet plus an English description
idtype plus an English description
kind plus an English description
eventexclude display as 'Y' or 'N'
qstag display as 'Y' or 'N'
rgexclude display as 'Y' or 'N'

This returns the document as a string.

Next: $event->toJson($print, $options)