/**
  * get optionrecords of given list of option-IDs
  *
  * @param string $optionList
  * @param boolean $returnSortedByTitle Default: Sort by the exact order as they appear in optionlist. This is usefull if the customer want's the same ordering as in the filterRecord (inline)
  * @return array Filteroptions
  */
 public function getFilterOptions($optionList, $returnSortedByTitle = false)
 {
     // check/convert if list contains only integers
     $optionIdArray = TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $optionList, true);
     $optionList = implode(',', $optionIdArray);
     if ($returnSortedByTitle) {
         $sortBy = 'title';
     } else {
         $sortBy = 'FIND_IN_SET(uid, "' . $GLOBALS['TYPO3_DB']->quoteStr($optionList, 'tx_kesearch_filteroptions') . '")';
     }
     // search for filteroptions
     $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_kesearch_filteroptions', 'pid in (' . $this->startingPoints . ') ' . 'AND FIND_IN_SET(uid, "' . $GLOBALS['TYPO3_DB']->quoteStr($optionList, 'tx_kesearch_filteroptions') . '") ' . $this->cObj->enableFields('tx_kesearch_filteroptions'), '', $sortBy, '');
     while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
         // Perform overlay on each record
         if (is_array($row) && $GLOBALS['TSFE']->sys_language_contentOL) {
             $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay('tx_kesearch_filteroptions', $row, $GLOBALS['TSFE']->sys_language_content, $GLOBALS['TSFE']->sys_language_contentOL);
         }
         $optionArray[$row['uid']] = $row;
     }
     return $optionArray;
 }