public function mergeRecord($record) {
    if ($this->isNew()) {
      throw new \Exception('Can not merge, is new');
    }
    foreach ($this->fields as $field_name => $field) {
      if (!empty($record[$field_name])) {
        $this->record[$field_name] = $record[$field_name];
      }
      $this->isDirty = TRUE;
    }

    return $this;
  }
public function mergeRecord($record) {
    if ($this->isNew()) {
      throw new \Exception('Can not merge, is new');
    }
    foreach ($this->fields as $field_name => $field) {
      if (!empty($record[$field_name])) {
        $this->record[$field_name] = $record[$field_name];
      }
      $this->isDirty = TRUE;
    }

    return $this;
  }
public function mergeRecord ( $ record ) { if ( $ this -> isNew ( ) ) { throw new \ Exception ( 'Can not merge, is new' ) ; } foreach ( $ this -> fields as $ field_name => $ field ) { if ( ! empty ( $ record [ $ field_name ] ) ) { $ this -> record [ $ field_name ] = $ record [ $ field_name ] ; } $ this -> isDirty = TRUE ; } return $ this ; }
Update partial values of the record and keep the current
non modified values.

@param $record
@return $this

@throws \Exception
Update partial values of the record and keep the current non modified values .