Controller routines for the chado CV Term autocomplete.
◆ formatCVterm()
static Drupal\tripal_chado\Controller\ChadoCVTermAutocompleteController::formatCVterm |
( |
int |
$id | ) |
|
|
static |
Given a cvterm id number, return the matching cvterm record using the format cvterm name (db.name:dbxref.accession).
- Parameters
-
integer | $id | Cvterm id number to match. |
- Returns
- string Cvterm record in cvterm name (db.name:dbxref.accession) format.
◆ getCVtermId()
static Drupal\tripal_chado\Controller\ChadoCVTermAutocompleteController::getCVtermId |
( |
string |
$term, |
|
|
|
$cv_name = '' |
|
) |
| |
|
static |
Fetch the cvterm.cvterm_id given a cvterm name (db.name:dbxref.accession) value returned by the handler method above.
- Parameters
-
string | $term | String value returned by autocomplete handler method. |
string | $cv_name | Optional name of a controlled vocabulary. Can be used if user bypassed autocomplete and entered just a CV term name manually. |
- Returns
- integer Id number corresponding to chado.cvterm_id field of the matching term or 0 if no match was found.
◆ handleAutocomplete()
Drupal\tripal_chado\Controller\ChadoCVTermAutocompleteController::handleAutocomplete |
( |
Request |
$request, |
|
|
int |
$count = 5 , |
|
|
int |
$cv_id = 0 |
|
) |
| |
Controller method, autocomplete cvterm name.
- Parameters
-
| Request | request |
int | $count | Desired number of matching names to suggest. Default to 5 items. Zero will disable autocomplete. |
int | $cv_id | Limit the match of term to the CV with this cv_id. Zero, the default, will return matches to any CV. |
- Returns
- Json Object Matching cvterm rows where each row is formatted as string: cvterm.name (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/ChadoCVTermAutocompleteController.php