src/Table/Table.php
protected function setFieldsTypeByName()
  {
    foreach($this->getFields() as $fieldName => $fieldInfos){
      $v = $this->row->get($fieldName);
      
      switch($fieldInfos->Type){
        case 'bigint':
        case 'mediumint':
        case 'smallint':
        case 'tinyint':
        case 'int':
          $this->row->set($fieldName, (int)$v); 
          break;
        
        case 'datetime':
        case 'timestamp':
          if ( $v === $this->db->getNullDate(true) ){
            $this->row->set($fieldName, ''); 
          }
          break;
        
        case 'date':
          if ( $v === $this->db->getNullDate(false) ){
            $this->row->set($fieldName, ''); 
          }
          break;
        
        case 'time':
          if ( $v === '00:00:00' ){
            $this->row->set($fieldName, ''); 
          }
          break;
      }
      
      if ( $fieldName === 'published' ){
        $this->row->set($fieldName, (bool)$v); 
      }
    }
  }
protected function setFieldsTypeByName()
  {
    foreach($this->getFields() as $fieldName => $fieldInfos){
      $v = $this->row->get($fieldName);
      
      switch($fieldInfos->Type){
        case 'bigint':
        case 'mediumint':
        case 'smallint':
        case 'tinyint':
        case 'int':
          $this->row->set($fieldName, (int)$v); 
          break;
        
        case 'datetime':
        case 'timestamp':
          if ( $v === $this->db->getNullDate(true) ){
            $this->row->set($fieldName, ''); 
          }
          break;
        
        case 'date':
          if ( $v === $this->db->getNullDate(false) ){
            $this->row->set($fieldName, ''); 
          }
          break;
        
        case 'time':
          if ( $v === '00:00:00' ){
            $this->row->set($fieldName, ''); 
          }
          break;
      }
      
      if ( $fieldName === 'published' ){
        $this->row->set($fieldName, (bool)$v); 
      }
    }
  }
protected function setFieldsTypeByName ( ) { foreach ( $ this -> getFields ( ) as $ fieldName => $ fieldInfos ) { $ v = $ this -> row -> get ( $ fieldName ) ; switch ( $ fieldInfos -> Type ) { case 'bigint' : case 'mediumint' : case 'smallint' : case 'tinyint' : case 'int' : $ this -> row -> set ( $ fieldName , ( int ) $ v ) ; break ; case 'datetime' : case 'timestamp' : if ( $ v === $ this -> db -> getNullDate ( true ) ) { $ this -> row -> set ( $ fieldName , '' ) ; } break ; case 'date' : if ( $ v === $ this -> db -> getNullDate ( false ) ) { $ this -> row -> set ( $ fieldName , '' ) ; } break ; case 'time' : if ( $ v === '00:00:00' ) { $ this -> row -> set ( $ fieldName , '' ) ; } break ; } if ( $ fieldName === 'published' ) { $ this -> row -> set ( $ fieldName , ( bool ) $ v ) ; } } }
Set data type for known fields

@return void
Set data type for known fields