/**
  * Fetch all records (optional filtered, sorted and limited).
  *
  * @param InterfaceGeneralDataConfig $objConfig The configuration to be applied.
  *
  * @return InterfaceGeneralCollection
  */
 public function fetchAll(InterfaceGeneralDataConfig $objConfig)
 {
     $strBackupLanguage = '';
     if ($this->strCurrentLanguage != '') {
         $strBackupLanguage = $GLOBALS['TL_LANGUAGE'];
         $GLOBALS['TL_LANGUAGE'] = $this->strCurrentLanguage;
     }
     $varResult = null;
     $arrSorting = $objConfig->getSorting();
     $strSortBy = '';
     $strSortDir = '';
     if ($arrSorting) {
         list($strSortBy, $strSortDir) = each($arrSorting);
     }
     if (!$strSortDir) {
         $strSortDir = DCGE::MODEL_SORTING_ASC;
     }
     $objFilter = $this->prepareFilter($objConfig->getFilter());
     if ($objConfig->getIdOnly()) {
         $varResult = $this->objMetaModel->getIdsFromFilter($objFilter, $strSortBy ? $strSortBy : '', $objConfig->getStart(), $objConfig->getAmount(), $strSortBy ? $strSortDir : '');
     } else {
         $objItems = $this->objMetaModel->findByFilter($objFilter, $strSortBy ? $strSortBy : '', $objConfig->getStart(), $objConfig->getAmount(), $strSortBy ? $strSortDir : '');
         $objResultCollection = $this->getEmptyCollection();
         foreach ($objItems as $objItem) {
             $objResultCollection->push(new GeneralModelMetaModel($objItem));
         }
         $varResult = $objResultCollection;
     }
     if ($strBackupLanguage != '') {
         $GLOBALS['TL_LANGUAGE'] = $strBackupLanguage;
     }
     return $varResult;
 }