/**
  * @param Noovias_Cron_Data_CronExpression $data
  * @return string
  * @throws Exception
  */
 protected function calculateDayOfMonth(Noovias_Cron_Data_CronExpression $data)
 {
     $dayofmonthoption = $data->getDayOfMonthOption();
     if ($dayofmonthoption === Noovias_Cron_Data_CronExpression::OPTION_EVERY) {
         return '*';
     }
     if ($dayofmonthoption === Noovias_Cron_Data_CronExpression::OPTION_SPECIFY) {
         if (!is_array($data->getSpecifyDayOfMonth())) {
             throw new Noovias_Cron_Exception_CouldNotGenerateCronExpression(self::GENERATION_EXCEPTION_MESSAGE);
         }
         return implode(',', $data->getSpecifyDayOfMonth());
     }
     if ($dayofmonthoption === Noovias_Cron_Data_CronExpression::OPTION_FROMTO) {
         return $data->getFromDayOfMonth() . '-' . $data->getToDayOfMonth();
     }
     // Throw exception if there was no return yet
     throw new Noovias_Cron_Exception_CouldNotGenerateCronExpression(self::GENERATION_EXCEPTION_MESSAGE);
 }