Esempio n. 1
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;
 }
Esempio n. 2
0
 protected function getSubpercentForStageCreateSearchIndex()
 {
     if ($this->getStep() == 0) {
         $this->data['OFFSET'] = 0;
     }
     if (!isset($this->data['INDEX_LOCATION_COUNT'])) {
         $item = Location\LocationTable::getList(array('select' => array('CNT'), 'filter' => ChainTable::getFilterForInitData(array('TYPES' => Finder::getIndexedTypes()))))->fetch();
         $this->data['INDEX_LOCATION_COUNT'] = intval($item['CNT']);
     }
     return $this->getSubPercentByTotalAndDone($this->data['INDEX_LOCATION_COUNT'], $this->data['OFFSET']);
 }