Event::toJson - jcobban/Genealogy GitHub Wiki

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

Up: class Event

This method creates a JavaScript Object Notation (JSON) representation of the object. 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. JSON is the most convenient form for the representation of an object in data sent from the server to the browser because it can be trivially converted into a JavaScript object.

parameter description
$print If this is omitted or true the JSON 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 declared 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: class Family