Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/kernel/db/dbitem.php
Show First 20 Lines • Show All 730 Lines • ▼ Show 20 Line(s) | |||||
if ( !$this->FieldValues ) { | if ( !$this->FieldValues ) { | ||||
// nothing to update | // nothing to update | ||||
return true; | return true; | ||||
} | } | ||||
$sql = ''; | $sql = ''; | ||||
$set_fields = isset($update_fields) ? $update_fields : array_keys($this->FieldValues); | if ( isset($update_fields) ) { | ||||
$set_fields = $update_fields; | |||||
$forgotten_fields = array_diff(array_keys($this->GetChangedFields()), $set_fields); | |||||
if ( $forgotten_fields ) { | |||||
trigger_error( | |||||
sprintf( | |||||
'These fields weren\'t updated for #%s record in "%s" unit: %s', | |||||
$this->GetID(), | |||||
$this->getPrefixSpecial(), | |||||
implode(', ', $forgotten_fields) | |||||
), | |||||
E_USER_WARNING | |||||
); | |||||
} | |||||
} | |||||
else { | |||||
$set_fields = array_keys($this->FieldValues); | |||||
} | |||||
foreach ($set_fields as $field_name) { | foreach ($set_fields as $field_name) { | ||||
if ( $this->skipField($field_name) ) { | if ( $this->skipField($field_name) ) { | ||||
continue; | continue; | ||||
} | } | ||||
$field_value = $this->FieldValues[$field_name]; | $field_value = $this->FieldValues[$field_name]; | ||||
▲ Show 20 Lines • Show All 869 Lines • Show Last 20 Lines |