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