本文整理汇总了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;
}
}
}