function tripal_pub_get_pub_by_uniquename

2.x tripal_pub.DEPRECATED.inc tripal_pub_get_pub_by_uniquename($uniquenname)
3.x tripal_pub.DEPRECATED.inc tripal_pub_get_pub_by_uniquename($uniquenname)
1.x tripal_pub.api.inc tripal_pub_get_pub_by_uniquename($name)

Returns the list of publications that match a given title, type and year

Parameters

title: The title of the publication to look for

type: Optional. The publication type. The value of this field should come from the Tripal Pub vocabulary. This should be the type name (e.g. cvterm.name)

year: Optional. The year the publication was published.

series_name: Optional. The name of the series (e.g. Journal name)

Return value

Returns an array of all the publications that have the provided cross reference. If no publications match, then an empty array is returned.

Related topics

1 call to tripal_pub_get_pub_by_uniquename()
chado_pub_validate in tripal_pub/includes/pub_form.inc

File

tripal_pub/api/tripal_pub.api.inc, line 595
The Tripal Pub API

Code

function tripal_pub_get_pub_by_uniquename($name) {

  $return = array();

  // build the values array for the query.
  $values = array(
    'uniquename' => $name,
  );
  $options = array(
    'statement_name' => 'sel_pub_un',
    'case_insensitive_columns' => array('uniquename'),
  );
  $results = tripal_core_chado_select('pub', array('pub_id'), $values, $options);

  // iterate through any matches and pull out the pub_id
  foreach ($results as $index => $pub) {
    $return[] = $pub->pub_id;
  }
  return $return;
}