/**
  * @param Noovias_Cron_Data_CronExpression $data
  * @return string
  * @throws Exception
  */
 protected function calculateHours(Noovias_Cron_Data_CronExpression $data)
 {
     $houroption = $data->getHourOption();
     if ($houroption === Noovias_Cron_Data_CronExpression::OPTION_EVERY) {
         return '*';
     }
     if ($houroption === Noovias_Cron_Data_CronExpression::OPTION_EVERYX) {
         return '*/' . $data->getEveryXHours();
     }
     if ($houroption === Noovias_Cron_Data_CronExpression::OPTION_SPECIFY) {
         if (!is_array($data->getSpecifyHours())) {
             throw new Noovias_Cron_Exception_CouldNotGenerateCronExpression(self::GENERATION_EXCEPTION_MESSAGE);
         }
         return implode(',', $data->getSpecifyHours());
     }
     if ($houroption === Noovias_Cron_Data_CronExpression::OPTION_FROMTO) {
         return $data->getFromHour() . '-' . $data->getToHour();
     }
     // Throw exception if there was no return yet
     throw new Noovias_Cron_Exception_CouldNotGenerateCronExpression(self::GENERATION_EXCEPTION_MESSAGE);
 }