public function actionGetObject($id)
 {
     $taxonomy = CTaxonomyManager::getLegacyTaxonomy($this->taxonomy);
     if (is_null($taxonomy)) {
         return null;
     }
     return $taxonomy->getTerm($id);
 }
 /**
  * @return array
  */
 private function getWorktypesAlias()
 {
     if (is_null($this->_workTypesAlias)) {
         $this->_workTypesAlias = array();
         foreach (CTaxonomyManager::getLegacyTaxonomy("spravochnik_uch_rab")->getTerms()->getItems() as $term) {
             $this->_workTypesAlias[$term->getId()] = $term->name_hours_kind;
         }
     }
     return $this->_workTypesAlias;
 }
 /**
  * @return CTerm
  */
 public function getLanguage()
 {
     if (is_null($this->_language)) {
         $tax = CTaxonomyManager::getLegacyTaxonomy("language");
         if (!is_null($tax)) {
             $this->_language = CTaxonomyManager::getLegacyTerm($this->language_id, $tax->getId());
         }
     }
     return $this->_language;
 }
 /**
  * @return CTerm|null
  */
 public function getSpeciality()
 {
     if (is_null($this->_speciality)) {
         $taxonomy = CTaxonomyManager::getLegacyTaxonomy(TAXONOMY_SPECIALITY);
         if (!is_null($taxonomy)) {
             $this->_speciality = $taxonomy->getTerm($this->alias);
         }
     }
     return $this->_speciality;
 }
 public function actionGetDefaultCatalogProperties()
 {
     $properties = array();
     $taxonomy = CTaxonomyManager::getLegacyTaxonomy("person_types");
     /**
      * @var $term CTerm
      */
     foreach ($taxonomy->getTerms()->getItems() as $term) {
         if ($term->getValue() == TYPE_PPS) {
             $properties[] = $term->getId();
         } elseif ($term->getValue() == "учебно-вспомогательный персонал") {
             $properties[] = $term->getId();
         } elseif ($term->getValue() == "аспирант") {
             $properties[] = $term->getId();
         }
     }
     $properties[] = "order";
     return $properties;
 }
 /**
  * @param $catalog
  * @return ISearchCatalogInterface
  * @throws Exception
  */
 private function searchObjectsFactory($catalog, $properties = array())
 {
     if ($catalog == "staff") {
         return new CSearchCatalogStaff(array("properties" => $properties));
     } elseif ($catalog == "student") {
         return new CSearchCatalogStudent(array("properties" => $properties));
     } elseif ($catalog == "studentgroup") {
         return new CSearchCatalogStudentGroup(array("properties" => $properties));
     } elseif ($catalog == "sab_commissions") {
         return new CSearchCatalogSABCommission(array());
     } elseif (CUtils::strLeft($catalog, ".") == "class") {
         $class = CUtils::strRight($catalog, ".");
         return new $class(array("properties" => $properties));
     } elseif (!is_null(CTaxonomyManager::getTaxonomy($catalog))) {
         return new CSearchCatalogTaxonomy(array("taxonomy" => $catalog, "properties" => $properties));
     } elseif (!is_null(CTaxonomyManager::getLegacyTaxonomy($catalog))) {
         return new CSearchCatalogTaxonomyLegacy(array("taxonomy" => $catalog, "properties" => $properties));
     } else {
         throw new Exception("Не могу найти каталог для поиска " . $catalog);
     }
 }
 public function actionDeleteLegacyTaxonomy()
 {
     $taxonomy = CTaxonomyManager::getLegacyTaxonomy(CRequest::getInt("id"));
     $taxonomy->remove();
     $this->redirect("?action=index");
 }