public function getFeed($index, $type) {
     $feeds = $this->getFeeds($type);
     if (isset($feeds[$index])) {
         $feedData = $feeds[$index];
         if (!isset($feedData['CONTROLLER_CLASS'])) {
             $feedData['CONTROLLER_CLASS'] = 'CalendarDataController';
         }
         $controller = CalendarDataController::factory($feedData['CONTROLLER_CLASS'],$feedData);
         $controller->setDebugMode(Kurogo::getSiteVar('DATA_DEBUG'));
         return $controller;
     } else {
         throw new Exception("Error getting calendar feed for index $index");
     }
 }
 public function getFeed($index, $type)
 {
     $feeds = $this->getFeeds($type);
     if (isset($feeds[$index])) {
         $feedData = $feeds[$index];
         if (!isset($feedData['CONTROLLER_CLASS'])) {
             $feedData['CONTROLLER_CLASS'] = 'CalendarDataController';
         }
         $controller = CalendarDataController::factory($feedData['CONTROLLER_CLASS'], $feedData);
         return $controller;
     } else {
         throw new KurogoConfigurationException($this->getLocalizedString("ERROR_NO_CALENDAR_FEED", $index));
     }
 }
Beispiel #3
0
 public function getFeed($index, $type)
 {
     $feeds = $this->getFeeds($type);
     if (isset($feeds[$index])) {
         $feedData = $feeds[$index];
         try {
             if (isset($feedData['CONTROLLER_CLASS'])) {
                 $modelClass = $feedData['CONTROLLER_CLASS'];
             } else {
                 $modelClass = isset($feedData['MODEL_CLASS']) ? $feedData['MODEL_CLASS'] : self::$defaultModel;
             }
             $controller = CalendarDataModel::factory($modelClass, $feedData);
         } catch (KurogoException $e) {
             $controller = CalendarDataController::factory($feedData['CONTROLLER_CLASS'], $feedData);
             $this->legacyController = true;
         }
         return $controller;
     } else {
         throw new KurogoConfigurationException($this->getLocalizedString("ERROR_NO_CALENDAR_FEED", $index));
     }
 }