src/Towel/Model/BaseModel.php
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;
  }
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;
  }
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 ; }
Sets the internal record with a new record.

@param $record

@return \Towel\Model\BaseModel
Sets the internal record with a new record .