original_string: private static function typeCastModel(LightModel $model)
      {
          if (in_array(self::OPTIONS_TYPECAST, self::$initOptions))
          {
              foreach ($model->getTable()->getColumns() as $column)
              {
                  /* @var $column Column */
                  if (in_array($column->getField(), get_object_vars($model)))
                  {
                      if ($column->getType() === Column::TYPE_INT)
                      {
                          $field = $column->getField();
                          settype($model->$field, Column::TYPE_INT);
                      }
                  }
              }
          }
  
          return $model;
      }
code: private static function typeCastModel(LightModel $model)
      {
          if (in_array(self::OPTIONS_TYPECAST, self::$initOptions))
          {
              foreach ($model->getTable()->getColumns() as $column)
              {
                  /* @var $column Column */
                  if (in_array($column->getField(), get_object_vars($model)))
                  {
                      if ($column->getType() === Column::TYPE_INT)
                      {
                          $field = $column->getField();
                          settype($model->$field, Column::TYPE_INT);
                      }
                  }
              }
          }
  
          return $model;
      }
code_tokens: private static function typeCastModel ( LightModel $ model ) { if ( in_array ( self :: OPTIONS_TYPECAST , self :: $ initOptions ) ) { foreach ( $ model -> getTable ( ) -> getColumns ( ) as $ column ) { /* @var $column Column */ if ( in_array ( $ column -> getField ( ) , get_object_vars ( $ model ) ) ) { if ( $ column -> getType ( ) === Column :: TYPE_INT ) { $ field = $ column -> getField ( ) ; settype ( $ model -> $ field , Column :: TYPE_INT ) ; } } } } return $ model ; }
docstring: Typecast the models columns to the associated mysql data types.
  
  @param LightModel $model
  @return LightModel
  
  TODO implement typecasting to other types
docstring_tokens: Typecast the models columns to the associated mysql data types .