Tripal
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
Drupal\tripal\Form\PubSearchQueryForm Class Reference
Inheritance diagram for Drupal\tripal\Form\PubSearchQueryForm:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal\Form\PubSearchQueryForm:
Collaboration graph
[legend]

Public Member Functions

 getFormId ()
 
 buildForm (array $form, FormStateInterface $form_state, $pub_import_id=NULL)
 
 submitForm (array &$form, FormStateInterface $form_state)
 
 validateForm (array &$form, FormStateInterface $form_state)
 

Protected Member Functions

 form_elements_load_previous_user_input (&$input, &$form_element)
 
 deleteRow (array $table, int $delete_id)
 
 form_elements_common ($form, FormStateInterface &$form_state)
 
 form_elements_specific_importer ($form, FormStateInterface $form_state)
 
 form_elements_importer_selection (array $form, FormStateInterface $form_state)
 
 submitFormSave (array &$form, FormStateInterface $form_state, array $user_input)
 
 submitFormTest (array &$form, FormStateInterface $form_state, array $user_input)
 
 criteria_convert_to_array ($form, FormStateInterface $form_state)
 

Member Function Documentation

◆ buildForm()

Drupal\tripal\Form\PubSearchQueryForm::buildForm ( array  $form,
FormStateInterface  $form_state,
  $pub_import_id = NULL 
)

◆ criteria_convert_to_array()

Drupal\tripal\Form\PubSearchQueryForm::criteria_convert_to_array (   $form,
FormStateInterface  $form_state 
)
protected

This function accepts the form state and converts the data into a criteria array.

This criteria array is later serialized and saved in the tripal_pub_library_query table as a row if Save Importer is clicked. This array will be given to the plugin test function to perform a test if Test Importer is clicked.

Parameters
array$formThe form where the settings form is being included in.
\Drupal\Core\Form\FormStateInterface$form_stateThe form state of the (entire) configuration form.
Returns
array

◆ deleteRow()

Drupal\tripal\Form\PubSearchQueryForm::deleteRow ( array  $table,
int  $delete_id 
)
protected

Removes a specified row from a table, and renames the internal keys to again be sequential.

Parameters
array$tableArray where second level keys are of the form /text-\d+/
int$delete_idThe first level key to remove
Returns
array Array in original order, but with specified row removed and second level keys renamed

◆ form_elements_common()

Drupal\tripal\Form\PubSearchQueryForm::form_elements_common (   $form,
FormStateInterface &  $form_state 
)
protected

Add form elements common to all importers

Parameters
array$formThe form array.
\Drupal\Core\Form\FormStateInterface$form_stateThe form state object.
int$num_criteriaThe number of criteria that exist for the importer
array$criteriaAn array of row indices for the form
Returns
A form array

◆ form_elements_importer_selection()

Drupal\tripal\Form\PubSearchQueryForm::form_elements_importer_selection ( array  $form,
FormStateInterface  $form_state 
)
protected

Add elements to the form to select a pub library plugin

Parameters
array$formThe form array.
\Drupal\Core\Form\FormStateInterface$form_stateThe form state object.
Returns
array The updated $form array

◆ form_elements_load_previous_user_input()

Drupal\tripal\Form\PubSearchQueryForm::form_elements_load_previous_user_input ( $input,
$form_element 
)
protected

Recursive function to find values from user_input and add it back to the #default_value key for the specific form elements.

Parameters
array&$inputNested array of user input values
array&$form_elementRender array for the form
Returns
void

◆ form_elements_specific_importer()

Drupal\tripal\Form\PubSearchQueryForm::form_elements_specific_importer (   $form,
FormStateInterface  $form_state 
)
protected

Add elements to the form that are specific to the specified plugin_id

Parameters
array$formThe form array.
\Drupal\Core\Form\FormStateInterface$form_stateThe form state object.
Returns
array The updated $form array

◆ getFormId()

Drupal\tripal\Form\PubSearchQueryForm::getFormId ( )

{}

◆ submitForm()

Drupal\tripal\Form\PubSearchQueryForm::submitForm ( array &  $form,
FormStateInterface  $form_state 
)

◆ submitFormSave()

Drupal\tripal\Form\PubSearchQueryForm::submitFormSave ( array &  $form,
FormStateInterface  $form_state,
array  $user_input 
)
protected

Handles submit when processing the save operation

Parameters
array&$formThe form array.
\Drupal\Core\Form\FormStateInterface$form_stateThe form state object.
array$user_inputUser input from $form_state->getUserInput()
Returns
void

◆ submitFormTest()

Drupal\tripal\Form\PubSearchQueryForm::submitFormTest ( array &  $form,
FormStateInterface  $form_state,
array  $user_input 
)
protected

Handles submit when processing the test operation

Parameters
array&$formThe form array.
\Drupal\Core\Form\FormStateInterface$form_stateThe form state object.
array$user_inputUser input from $form_state->getUserInput()
Returns
void

◆ validateForm()

Drupal\tripal\Form\PubSearchQueryForm::validateForm ( array &  $form,
FormStateInterface  $form_state 
)

{}


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