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;
    }
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;
    }
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 ; }
Typecast the models columns to the associated mysql data types.

@param LightModel $model
@return LightModel

TODO implement typecasting to other types
Typecast the models columns to the associated mysql data types .