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

Public Member Functions

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

Static Public Member Functions

static getCVtermId (string $term, $cv_name='')
 
static formatCVterm (int $id)
 

Detailed Description

Controller routines for the chado CV Term autocomplete.

Member Function Documentation

◆ 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$idCvterm 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$termString value returned by autocomplete handler method.
string$cv_nameOptional 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
Requestrequest
int$countDesired number of matching names to suggest. Default to 5 items. Zero will disable autocomplete.
int$cv_idLimit 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: