Person::delete - jcobban/Genealogy GitHub Wiki
Up: class Person
This method deletes the record from the database server. If $person‑>isExisting()
is false this does nothing and returns 0. If $person->isExisting()
is true the existing database record is deleted and the method returns an array containing statistics about all of the related records that are deleted when a Person is deleted.
parameter | description |
---|---|
$xml | If the value is boolean true then a representation of the SQL command issued to update the database is printed on the output enclosed in an XML <cmd> tag. If the value is a string then the representation of the SQL command issued to update the database is printed on the output enclosed in an XML <$xml> tag. If the leading characters of the string contain spaces these are extracted and used as an indentation value before the tag and end-tag. If there are any characters after a valid XML tag name these are extracted and presented only in the opening tag. Otherwise no output is generated. |
For example if the text is to be displayed as part of a web page then you may set the parameter to 'p'
or " p class='cssclassname'"
.
The method returns boolean false
if the method was unable to update the database, it returns 0 if the database did not need to be updated because there was no record to delete. Otherwise the method returns an array containing statistics about all of the related records that are deleted when a Person is deleted.
name | contents |
---|---|
'altNameCount' | number of instances of class Name deleted |
'citCount' | number of instances of class Citation deleted |
'eventCount' | number of instances of class Event deleted |
'indivCount' | number of instances of class Person deleted, that is 1 |
The method throws an Exception
if user is not authorized to update the database.
Next: class PersonSet