Esempio n. 1
0
 protected function stageResortDictionaryBefore()
 {
     if (!isset($this->data['WORD_TABLE_INSTANCE_SERIALIZED'])) {
         $instance = new WordTable(array('TYPES' => Finder::getIndexedTypes(), 'LANGS' => Finder::getIndexedLanguages()));
     } else {
         $instance = unserialize($this->data['WORD_TABLE_INSTANCE_SERIALIZED']);
     }
     $this->wordInstance = $instance;
 }
Esempio n. 2
0
 /**
  * Here we get some data that cannot be cached for a long time
  * @return boolean
  */
 protected function obtainNonCachedData()
 {
     // types
     $types = LocationHelper::getTypeList();
     $selectedTypes = array_flip(Search\Finder::getIndexedTypes());
     $this->dbResult['TYPES'] = array();
     foreach ($types as $id => $name) {
         $this->dbResult['TYPES'][$id] = array('NAME' => $name, 'SELECTED' => isset($selectedTypes[$id]));
     }
     // langs
     $langs = TypeHelper::getLanguageList();
     $selectedLangs = array_flip(Search\Finder::getIndexedLanguages());
     $this->dbResult['LANGS'] = array();
     foreach ($langs as $id => $name) {
         $this->dbResult['LANGS'][$id] = array('NAME' => $name, 'SELECTED' => isset($selectedLangs[$id]));
     }
     return true;
 }