GridView sort by weekday name

I have the following table…




        $this->createTable('{{%date_availability}}', [

            'entity_id' => Schema::TYPE_INTEGER . ' NOT NULL',

            'period_id' => Schema::TYPE_INTEGER . ' NOT NULL',

            'table_name' => Schema::TYPE_STRING . '(255) NOT NULL',

            'day_of_week' => Schema::TYPE_STRING . '(10) NOT NULL',

            'open_time' => Schema::TYPE_TIME . ' NOT NULL',

            'close_time' => Schema::TYPE_TIME . ' NOT NULL',

            'PRIMARY KEY (`entity_id`, `period_id`, `table_name`, `day_of_week`)',

        ], $tableOptions);



My first question is what is the best way to save the weekday. Right now I’m just saving it as a string “sunday”, “monday”, “tuesday” etc. Is that a legit way to save it or should I be using an integer?

I would like to sort my gridview by the order of the weekday not the alphabetical name. How would I go about this if I’m saving the “day_of_week” as a string. If I used an integer it would be easy but from what I understand, mysql and php have different starting index numbers. For example in mysql Monday might be 0 but in PHP Monday might be 1. Is that the case?