Record::save - jcobban/Genealogy GitHub Wiki
$record->save()
Up: class Record
This method updates the record contents in the database server. If previously detected errors have been accumulated in $this‑>msg
this method suppresses the update, generates a warning that includes the text of the messages to explain why the record was not updated, and returns 0. If $record‑>isExisting()
is false this inserts a new record into the table. The value of the primary key is not passed in the INSERT if it is an auto-increment field, whose value will be determined by the database server. If $record->isExisting()
is true the existing database record is updated.
The method returns boolean false
if the method was unable to update the database, for example because the current user is not authorized to update the database. $record->getErrors()
should be called to obtain a string explaining why the method failed. The method returns 1 if the method updated the database record, or 0 if the database did not need to be updated because there were no changes to the record. $record->getLastSqlCmd()
may be called to get the command which was used to update the database.
Next: $record->changed()