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

Public Member Functions

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

Static Public Member Functions

static getProjectId (string $project)
 
static getProjectName (int $project)
 

Detailed Description

Controller, Chado Project Autocomplete.

Member Function Documentation

◆ getProjectId()

static Drupal\tripal_chado\Controller\ChadoProjectAutocompleteController::getProjectId ( string  $project)
static

Fetch the project id number, given a project name value.

Parameters
string$projectProject name value.
Returns
integer Project id number of the project name or 0 if no matching project record was found.

◆ getProjectName()

static Drupal\tripal_chado\Controller\ChadoProjectAutocompleteController::getProjectName ( int  $project)
static

Fetch the project name, given a project id number.

Parameters
int$projectProject id number value.
Returns
string Corresponding project name of the project id number or empty string if no matching project record was found.

◆ handleAutocomplete()

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

Controller method, autocomplete project name.

Parameters
Requestrequest
int$countDesired number of matching names to suggest. Default to 5 items. Must be declared in autocomplete route parameter i.e. ['count' => 5].
int$type_idProject type set in projectprop.type_id to restrict projects to specific type. Default to 0, return projects regardless of type. Must be declared in autocomplete route parameter i.e. ['type_id' => 0].
Returns
Json Object Matching project rows in an array where project name is both the value to the array keys label and value.

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