Merge branch 'storageareas' of github.com:connortechnology/ZoneMinder into storageareas

This commit is contained in:
Isaac Connor 2017-12-22 09:03:11 -08:00
commit cc8ed75eb9
1 changed files with 5 additions and 3 deletions

View File

@ -293,8 +293,8 @@ private $control_fields = array(
}
return $filters;
}
public function save( $new_values = null ) {
public function save( $new_values = null ) {
if ( $new_values ) {
foreach ( $new_values as $k=>$v ) {
@ -302,8 +302,10 @@ private $control_fields = array(
}
}
$sql = 'UPDATE Monitors SET '.implode(', ', array_map( function($field) {return $field.'=?';}, array_keys( $this->defaults ) ) ) . ' WHERE Id=?';
$values = array_map( function($field){return $this->{$field};}, $this->fields );
$fields = array_keys( $this->defaults );
$sql = 'UPDATE Monitors SET '.implode(', ', array_map( function($field) {return $field.'=?';}, $fields ) ) . ' WHERE Id=?';
$values = array_map( function($field){return $this->{$field};}, $fields );
$values[] = $this->{'Id'};
dbQuery( $sql, $values );
} // end function save