Example #1
0
 /**
  * 
  * Delete the record from the db. 
  * 
  * If deletion was successful and the primary key column for the record's db
  * table is auto-incrementing, then unset the primary key field in the data 
  * contained in the record object.
  * 
  * NOTE: data contained in the record include $this->_data, $this->_related_data
  *       and $this->_initial_data.
  * 
  * @param bool $set_record_objects_data_to_empty_array true to reset the record object's data to an empty array if db deletion was successful, false to keep record object's data
  * 
  * @return bool true if record was successfully deleted from db or false if not
  * 
  */
 public function delete($set_record_objects_data_to_empty_array = false)
 {
     $result = $this->_model->deleteSpecifiedRecord($this);
     if ($result === true && $set_record_objects_data_to_empty_array) {
         $this->_related_data = $this->_initial_data = $this->_data = array();
     }
     return $result;
 }