Tripal
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Drupal\tripal_chado\Controller\ChadoOrganismAutocompleteController Class Reference
Inheritance diagram for Drupal\tripal_chado\Controller\ChadoOrganismAutocompleteController:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal_chado\Controller\ChadoOrganismAutocompleteController:
Collaboration graph
[legend]

Public Member Functions

 handleAutocomplete (Request $request, int $match_limit=5)
 
- Public Member Functions inherited from Drupal\tripal_chado\Controller\ChadoGenericAutocompleteController
 handleGenericAutocomplete (Request $request, string $base_table, string $column_name, string $type_column, string $property_table, int $match_limit=10, int $type_id=0,)
 

Static Public Member Functions

static getQuery (string $string, array $options)
 
static getPkeyId (string $value)
 
- Static Public Member Functions inherited from Drupal\tripal_chado\Controller\ChadoGenericAutocompleteController
static getDefaultOptions ()
 

Additional Inherited Members

- Protected Attributes inherited from Drupal\tripal_chado\Controller\ChadoGenericAutocompleteController
bool $include_pkey = TRUE
 
string $match_operator = 'CONTAINS'
 
- Static Protected Attributes inherited from Drupal\tripal_chado\Controller\ChadoGenericAutocompleteController
static array $default_options = []
 

Detailed Description

Controller, Chado Organism Autocomplete.

Deprecated:
in tripal:4.0.0-alpha3 and is removed from tripal:4.1.0. All the methods in ChadoOrganismAutocompleteController now exist in ChadoOrganismFormElement class with the same functionality. Use \Drupal\tripal_chado\Controller\ChadoOrganismFormElement instead.
See also
https://tripaldoc.readthedocs.io/en/latest/dev_guide/deprecations/organism_autocomplete.html

Member Function Documentation

◆ getPkeyId()

static Drupal\tripal_chado\Controller\ChadoOrganismAutocompleteController::getPkeyId ( string  $value)
static

Fetch the pkey organism_id number, given an autocomplete value with a numeric ID in parentheses at the end of the string.

Parameters
string$valueA value from an autocomplete with the ID in parentheses at the end, e.g. "Tripalus bogusii (ignored) (123)"
Returns
int Primary key ID number of the record, or 0 if an unparsable $value was passed, which can happen if the user did not let the autocomplete supply a value.

Reimplemented from Drupal\tripal_chado\Controller\ChadoGenericAutocompleteController.

◆ getQuery()

static Drupal\tripal_chado\Controller\ChadoOrganismAutocompleteController::getQuery ( string  $string,
array  $options 
)
static

Returns a database query ready to execute.

This allows the same query to be used for both autocomplete and select.

Parameters
string$stringThe string to be autocompleted, used to limit the query. The string "%" has the special meaning of return all records.
array$optionsThe following keys are used: match_operator - Either 'CONTAINS' (default) or 'STARTS_WITH'. match_limit - Desired number of autocomplete matching names to suggest, default 10. If zero, there is no limit.
Returns
?\Drupal\pgsql\Driver\Database\pgsql\Select $query A database query object

Reimplemented from Drupal\tripal_chado\Controller\ChadoGenericAutocompleteController.

◆ handleAutocomplete()

Drupal\tripal_chado\Controller\ChadoOrganismAutocompleteController::handleAutocomplete ( Request  $request,
int  $match_limit = 5 
)

Controller method, autocomplete organism name.

Parameters
Requestrequest
int$match_limitDesired number of matching organism names to suggest. Default to 5 items. Must be declared in autocomplete route parameter i.e. ['match_limit' => 5].
Returns
Json Object Matching organism rows in an array where organism name is both the value to the array keys label and value.

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