Tripal
Public Member Functions | Static Public Member Functions | List of all members
Drupal\tripal_chado\Controller\ChadoDbxrefAutocompleteController Class Reference
Inheritance diagram for Drupal\tripal_chado\Controller\ChadoDbxrefAutocompleteController:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal_chado\Controller\ChadoDbxrefAutocompleteController:
Collaboration graph
[legend]

Public Member Functions

 handleAutocomplete (Request $request, int $count=5, int $db_id=0)
 

Static Public Member Functions

static getDbxrefId (string $accession, $db_id=null)
 
static formatDbxref (int $id)
 

Detailed Description

Controller routines for the chado DB xref autocomplete.

Member Function Documentation

◆ formatDbxref()

static Drupal\tripal_chado\Controller\ChadoDbxrefAutocompleteController::formatDbxref ( int  $id)
static

Given a dbxref id number, return the matching dbxref record using the format db.name:dbxref.accession

Parameters
integer$idDbxref id number to match.
Returns
string Dbxref record in db.name:dbxref.accession format.

◆ getDbxrefId()

static Drupal\tripal_chado\Controller\ChadoDbxrefAutocompleteController::getDbxrefId ( string  $accession,
  $db_id = null 
)
static

Fetch the dbxref.dbxref_id given a dbxref name (db.name:dbxref.accession) value returned by the handler method above.

Parameters
string$accessionString value returned by autocomplete handler method. Case sensitive.
string$db_idOptional db_id of a database. Can be used if user bypassed autocomplete and entered just a dbxref accession manually. Case sensitive.
Returns
integer Id number corresponding to chado.dbxref_id field of the matching accession or 0 if no match or multiple matches were found.

◆ handleAutocomplete()

Drupal\tripal_chado\Controller\ChadoDbxrefAutocompleteController::handleAutocomplete ( Request  $request,
int  $count = 5,
int  $db_id = 0 
)

Controller method, autocomplete db:accession. Not case sensitive.

Parameters
Requestrequest
int$countDesired number of matching names to suggest. Default to 5 items. Zero will disable autocomplete.
int$db_idLimit the match of term to the DB with this db_id. Zero, the default, will return matches to any DB.
Returns
Json Object Matching dbxref rows where each row is formatted as string: db.name:dbxref.accession and is the value for the object keys label and value.

The documentation for this class was generated from the following file: