當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Rank::kingdom_rank_ids方法代碼示例

本文整理匯總了PHP中Rank::kingdom_rank_ids方法的典型用法代碼示例。如果您正苦於以下問題:PHP Rank::kingdom_rank_ids方法的具體用法?PHP Rank::kingdom_rank_ids怎麽用?PHP Rank::kingdom_rank_ids使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Rank的用法示例。


在下文中一共展示了Rank::kingdom_rank_ids方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: lookup_taxon_name_batch

 private function lookup_taxon_name_batch($taxon_concept_ids)
 {
     $entry_taxon_concept_ids = array();
     foreach ($GLOBALS['db_connection']->iterate("\n            SELECT pref.taxon_concept_id, he.id, n.string\n            FROM taxon_concept_preferred_entries pref\n            JOIN hierarchy_entries he ON (pref.hierarchy_entry_id=he.id)\n            LEFT JOIN names n ON (he.name_id=n.id)\n            WHERE pref.taxon_concept_id IN (" . implode(",", $taxon_concept_ids) . ")") as $row) {
         $entry_taxon_concept_ids[$row['id']] = $row['taxon_concept_id'];
         $this->taxon_concept_names[$row['taxon_concept_id']]['scientificName'] = $row['string'];
     }
     $kingdom_ids = Rank::kingdom_rank_ids();
     $phylum_ids = Rank::phylum_rank_ids();
     // $class_ids = Rank::class_rank_ids();
     // $order_ids = Rank::order_rank_ids();
     $family_ids = Rank::family_rank_ids();
     // $all_rank_ids = array_merge($kingdom_ids, $phylum_ids, $class_ids, $order_ids, $family_ids);
     $all_rank_ids = array_merge($kingdom_ids, $phylum_ids, $family_ids);
     foreach ($GLOBALS['db_connection']->iterate("\n            SELECT hef.hierarchy_entry_id, he.id, he.rank_id, n.string\n            FROM hierarchy_entries_flattened hef\n            JOIN hierarchy_entries he ON (hef.ancestor_id=he.id)\n            LEFT JOIN names n ON (he.name_id=n.id)\n            WHERE hef.hierarchy_entry_id IN (" . implode(",", array_keys($entry_taxon_concept_ids)) . ")\n            AND he.rank_id IN (" . implode(",", $all_rank_ids) . ")") as $row) {
         $taxon_concept_id = $entry_taxon_concept_ids[$row['hierarchy_entry_id']];
         $name_string = $row['string'];
         if (Name::is_surrogate($name_string)) {
             continue;
         }
         if (in_array($row['rank_id'], $kingdom_ids)) {
             $this->taxon_concept_names[$taxon_concept_id]['kingdom'] = $name_string;
         } elseif (in_array($row['rank_id'], $phylum_ids)) {
             $this->taxon_concept_names[$taxon_concept_id]['phylum'] = $name_string;
         } elseif (in_array($row['rank_id'], $family_ids)) {
             $this->taxon_concept_names[$taxon_concept_id]['family'] = $name_string;
         }
     }
 }
開發者ID:eliagbayani,項目名稱:maps_test,代碼行數:29,代碼來源:EnvironmentsDataConnector.php


注:本文中的Rank::kingdom_rank_ids方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。