Skip to content

Family::delete

James Cobban edited this page Nov 3, 2019 · 1 revision

$family->delete($xml)

Up: class Family

This method deletes the record from the database server. If $family‑>isExisting() is false this does nothing and returns 0. If $family->isExisting() is true the existing database record is deleted and the method returns 1.

This method is extended to delete associated instances of class Citation and class Event.

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 1.

The method throws an Exception if user is not authorized to update the database.

Next: class FieldComment

Clone this wiki locally