/**
  * @param Noovias_Cron_Data_CronExpression $data
  * @return string
  * @throws Exception
  */
 protected function calculateDayOfWeek(Noovias_Cron_Data_CronExpression $data)
 {
     $dayofweekoption = $data->getDayOfWeekOption();
     if ($dayofweekoption === Noovias_Cron_Data_CronExpression::OPTION_EVERY) {
         return '*';
     }
     if ($dayofweekoption === Noovias_Cron_Data_CronExpression::OPTION_SPECIFY) {
         if (!is_array($data->getSpecifyDayOfWeek())) {
             throw new Noovias_Cron_Exception_CouldNotGenerateCronExpression(self::GENERATION_EXCEPTION_MESSAGE);
         }
         return implode(',', $data->getSpecifyDayOfWeek());
     }
     if ($dayofweekoption === Noovias_Cron_Data_CronExpression::OPTION_FROMTO) {
         return $data->getFromDayOfWeek() . '-' . $data->getToDayOfWeek();
     }
     // Throw exception if there was no return yet
     throw new Noovias_Cron_Exception_CouldNotGenerateCronExpression(self::GENERATION_EXCEPTION_MESSAGE);
 }