new ToDo - jcobban/Genealogy GitHub Wiki

new ToDo($parms)

Up: class ToDo

The constructor for an instance of ToDo takes one parameter:

parameter description
$parms identifies the database record to be associated with this instance. This is an associative array.

$parms may be:

  • An associative array containing all of the fields in a record as obtained by a database SELECT.
  • array('idtd' => integer) specifies the unique numeric key of the existing record in the table that is to be used to initialize the new instance.
  • array('idir' -> $idir, 'todoname' => string) specifies a named instance within a specific Person that is to be used to initialize the new instance. This may either be an existing or a new item. Note that 'idir' is zero for research tasks which are not specific to a particular Person.
  • if the parameter is omitted, or is an empty array, then a new record is create with all default values. The values of the 'idir' and 'todoname' field combination must be unique when the record is saved.

The constructor adds error messages to $record->msg if it is unable to complete due to bad parameters.

Next: $todo->getName()