original_string: public function setRecord($record) {
      $this->resetObject();
      $newRecord = array();
      foreach ($this->fields as $field_name => $field) {
        if (!empty($record[$field_name])) {
          $newRecord[$field_name] = $record[$field_name];
        }
        else {
          $newRecord[$field_name] = ''; //Adds the field but with empty string.
        }
      }
      $this->record = $newRecord;
      $this->fetchedRecord = $record;
  
      return $this;
    }
code: public function setRecord($record) {
      $this->resetObject();
      $newRecord = array();
      foreach ($this->fields as $field_name => $field) {
        if (!empty($record[$field_name])) {
          $newRecord[$field_name] = $record[$field_name];
        }
        else {
          $newRecord[$field_name] = ''; //Adds the field but with empty string.
        }
      }
      $this->record = $newRecord;
      $this->fetchedRecord = $record;
  
      return $this;
    }
code_tokens: public function setRecord ( $ record ) { $ this -> resetObject ( ) ; $ newRecord = array ( ) ; foreach ( $ this -> fields as $ field_name => $ field ) { if ( ! empty ( $ record [ $ field_name ] ) ) { $ newRecord [ $ field_name ] = $ record [ $ field_name ] ; } else { $ newRecord [ $ field_name ] = '' ; //Adds the field but with empty string. } } $ this -> record = $ newRecord ; $ this -> fetchedRecord = $ record ; return $ this ; }
docstring: Sets the internal record with a new record.
  
  @param $record
  
  @return \Towel\Model\BaseModel
docstring_tokens: Sets the internal record with a new record .