original_string: 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;
    }
code: 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;
    }
code_tokens: 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 ; }
docstring: Update partial values of the record and keep the current
  non modified values.
  
  @param $record
  @return $this
  
  @throws \Exception
docstring_tokens: Update partial values of the record and keep the current non modified values .