Controller routines for the chado DB xref autocomplete.
◆ 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 | $id | Dbxref 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 | $accession | String value returned by autocomplete handler method. Case sensitive. |
string | $db_id | Optional 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
-
| Request | request |
int | $count | Desired number of matching names to suggest. Default to 5 items. Zero will disable autocomplete. |
int | $db_id | Limit 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:
- tripal_chado/src/Controller/ChadoDbxrefAutocompleteController.php