/**
  * Standard SS method
  * Sets the days available for repeating orders.
  */
 function onBeforeWrite()
 {
     parent::onBeforeWrite();
     $days = explode(",", $this->OrderDays);
     $cleanDays = array();
     if (count($days)) {
         foreach ($days as $day) {
             $day = trim($day);
             if (count(self::$week_days)) {
                 foreach (self::$week_days as $perfectDay) {
                     if (strtolower($day) == strtolower($perfectDay)) {
                         $cleanDays[$perfectDay] = $perfectDay;
                     }
                 }
             }
         }
     }
     if (count($cleanDays)) {
         $this->OrderDays = implode(",", $cleanDays);
     } else {
         $this->OrderDays = implode(",", self::$week_days);
     }
 }