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;
  }