Revision 34852f2d
Added by Andreas Kohlbecker over 4 years ago
modules/cdm_dataportal/includes/name.inc | ||
---|---|---|
1556 | 1556 |
* @param $synonymy_group |
1557 | 1557 |
* An array containing a homotypic or heterotypic group of names. |
1558 | 1558 |
* @param $accepted_taxon_name_uuid |
1559 |
* The uuid of the accepted taxon name. Optional parameter. The type designations associated |
|
1560 |
* with the accepted name will be added to the resulting list also. |
|
1559 |
* The uuid of the accepted taxon name. Optional parameter which is required when composing |
|
1560 |
* the information for the homotypic group. In this case the accepted taxon is not included |
|
1561 |
* in the $synonymy_group and must therefor passed in this second parameter. |
|
1562 |
* |
|
1561 | 1563 |
* @return array |
1562 | 1564 |
* The type designations |
1563 | 1565 |
*/ |
1564 | 1566 |
function type_designations_for_synonymy_group($synonymy_group, $accepted_taxon_name_uuid = null) |
1565 | 1567 |
{ |
1566 | 1568 |
if (count($synonymy_group) > 0) { |
1567 |
$synonym = array_pop($synonymy_group); |
|
1568 |
$type_designations = cdm_ws_get(CDM_WS_PORTAL_NAME_TYPEDESIGNATIONS_IN_HOMOTYPICAL_GROUP, $synonym->name->uuid); |
|
1569 |
if($type_designations) { |
|
1569 |
$name_uuid = array_pop($synonymy_group)->name->uuid; |
|
1570 |
} else { |
|
1571 |
$name_uuid = $accepted_taxon_name_uuid; |
|
1572 |
} |
|
1573 |
if ($name_uuid) { |
|
1574 |
$type_designations = cdm_ws_get(CDM_WS_PORTAL_NAME_TYPEDESIGNATIONS_IN_HOMOTYPICAL_GROUP, $name_uuid); |
|
1575 |
if ($type_designations) { |
|
1570 | 1576 |
return $type_designations; |
1571 | 1577 |
} |
1572 | 1578 |
} |
1579 |
|
|
1573 | 1580 |
return array(); |
1574 | 1581 |
} |
1575 | 1582 |
|
Also available in: Unified diff
ref #8415 using accepted name uuid to get the types if no other taxa are in the homotypical group