function tripal_db_add_dbxref_link
2.x tripal_db.DEPRECATED.inc | tripal_db_add_dbxref_link($linking_table, $dbxref_id, $foreignkey_name, $foreignkey_id) |
3.x tripal_db.DEPRECATED.inc | tripal_db_add_dbxref_link($linking_table, $dbxref_id, $foreignkey_name, $foreignkey_id) |
Deprecated
Restructured API to make naming more readable and consistent. Function was deprecated in Tripal 2.0 and will be removed 2 releases from now. This function has been replaced by tripal_associate_dbxref().
See also
File
- tripal_db/
api/ tripal_db.DEPRECATED.inc, line 213 - Wrapper functions to provide backwards compatibility for the tripal db api
Code
function tripal_db_add_dbxref_link($linking_table, $dbxref_id, $foreignkey_name, $foreignkey_id) {
tripal_report_error(
'tripal_deprecated',
TRIPAL_NOTICE,
"DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
array(
'%old_function' => 'tripal_db_add_dbxref_link',
'%new_function' => 'tripal_associate_dbxref'
)
);
if (preg_match('/(\w+)_dbxref/', $linking_table, $matches)) {
$basetable = $matches[1];
return tripal_associate_dbxref($basetable, $foreignkey_id, array('dbxref_id' => $dbxref_id));
}
else {
return FALSE;
}
}