/**
  * Build a single time table by group
  *
  * @param ConfigurationGroup $group
  *
  * @return array
  */
 protected function buildSingleTimeTableByGroup(ConfigurationGroup $group)
 {
     $ids = array();
     foreach ($group->getConfigurations() as $configuration) {
         if ($configuration instanceof Configuration) {
             $ids[] = $configuration->getUid();
         }
     }
     return $this->timeTableService->getTimeTablesByConfigurationIds($ids);
 }
 /**
  * Build the index for one element
  *
  * @param string $configurationKey
  * @param string $tableName
  * @param int    $uid
  *
  * @return void
  */
 protected function updateIndex($configurationKey, $tableName, $uid)
 {
     $rawRecord = BackendUtility::getRecord($tableName, $uid);
     if (!$rawRecord) {
         return;
     }
     $configurations = GeneralUtility::intExplode(',', $rawRecord['calendarize'], TRUE);
     $neededItems = array();
     if ($configurations) {
         $timeTableService = new TimeTableService();
         $neededItems = $timeTableService->getTimeTablesByConfigurationIds($configurations);
         foreach ($neededItems as $key => $record) {
             $record['foreign_table'] = $tableName;
             $record['foreign_uid'] = $uid;
             $record['unique_register_key'] = $configurationKey;
             $this->prepareRecordForDatabase($record);
             $neededItems[$key] = $record;
         }
     }
     $this->addEnableFieldInformation($neededItems, $tableName, $rawRecord);
     $this->insertAndUpdateNeededItems($neededItems, $tableName, $uid);
 }