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

Public Member Functions

 __construct (array $configuration, $plugin_id, $plugin_definition, ChadoConnection $connection)
 
 getChadoConnection ()
 
 form ($form, &$form_state)
 
 addAnalysis ($form, &$form_state)
 
- Public Member Functions inherited from Drupal\tripal\TripalImporter\TripalImporterBase
 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 describeUploadFileFormat ()
 
 setJob ($job)
 
 createImportJob ($run_args, $file_details=[])
 
 load ($import_id)
 
 submitJob ()
 
 prepareFiles ()
 
 cleanFile ()
 
 getArguments ()
 
- Public Member Functions inherited from Drupal\tripal\TripalImporter\Interfaces\TripalImporterInterface
 formSubmit ($form, &$form_state)
 
 formValidate ($form, &$form_state)
 
 run ()
 
 postRun ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Protected Attributes

 $chado_schema_main
 
 $messenger = NULL
 
 $connection
 
- Protected Attributes inherited from Drupal\tripal\TripalImporter\TripalImporterBase
 $job
 
 $logger
 
 $arguments
 
 $import_id
 
 $is_prepared
 
 $messenger = NULL
 
 $reported
 
 $plugin_id
 
 $plugin_definition
 

Additional Inherited Members

- Protected Member Functions inherited from Drupal\tripal\TripalImporter\TripalImporterBase
 setTotalItems ($total_items)
 
 addItemsHandled ($num_handled)
 
 setItemsHandled ($total_handled)
 
 setInterval ($interval)
 

Detailed Description

Defines an interface for tripal importer plugins.

Constructor & Destructor Documentation

◆ __construct()

Drupal\tripal_chado\TripalImporter\ChadoImporterBase::__construct ( array  $configuration,
  $plugin_id,
  $plugin_definition,
ChadoConnection  $connection 
)

Implements __contruct().

Since we have implemented the ContainerFactoryPluginInterface, the constructor will be passed additional parameters added by the create() function. This allows our plugin to use dependency injection without our plugin manager service needing to worry about it.

Parameters
array$configuration
string$plugin_id
mixed$plugin_definition
Drupal\tripal_chado\Database\ChadoConnection$connection

Member Function Documentation

◆ addAnalysis()

Drupal\tripal_chado\TripalImporter\ChadoImporterBase::addAnalysis (   $form,
$form_state 
)

{Adds the form elements necessary for selecting an analaysis to the form.While every Importer must implement this function, Ideally it should be implomented by a child abstract Base class for each data store (e.g. Chado) and each importer should extend the new Base class to inherit the function. This will allow for consistency in the way the analysi form element is presented for all Importers working on the same data store.

Parameters
array$formThe form array definition.
\Drupal\Core\Form\FormStateInterface$form_stateThe form state object.
Returns
array An arrya definition containing the form elements for selecting an analysis.
}

Implements Drupal\tripal\TripalImporter\Interfaces\TripalImporterInterface.

◆ create()

static Drupal\tripal_chado\TripalImporter\ChadoImporterBase::create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

Implements ContainerFactoryPluginInterface->create().

Since we have implemented the ContainerFactoryPluginInterface this static function will be called behind the scenes when a Plugin Manager uses createInstance(). Specifically this method is used to determine the parameters to pass to the contructor.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$container
array$configuration
string$plugin_id
mixed$plugin_definition
Returns
static

◆ form()

Drupal\tripal_chado\TripalImporter\ChadoImporterBase::form (   $form,
$form_state 
)

{Provides form elements to be added to the loader form.These form elements are added after the file uploader section that is automaticaly provided by the TripalImporter.

Parameters
array$formThe form array definition.
\Drupal\Core\Form\FormStateInterface$form_stateThe form state object.
Returns
array A new form array definition.
}

Implements Drupal\tripal\TripalImporter\Interfaces\TripalImporterInterface.

Reimplemented in Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter, Drupal\tripal_chado\Plugin\TripalImporter\OBOImporter, Drupal\tripal_chado\Plugin\TripalImporter\NewickImporter, Drupal\tripal_chado\Plugin\TripalImporter\GFF3Importer, and Drupal\tripal_chado\Plugin\TripalImporter\FASTAImporter.

◆ getChadoConnection()

Drupal\tripal_chado\TripalImporter\ChadoImporterBase::getChadoConnection ( )

Gets a chado database connection set to the correct schema.

Requires you to call the parent::form in your form.


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