Tripal
List of all members
Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage Class Reference
Inheritance diagram for Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage:
Collaboration graph
[legend]

Public Member Functions

 addTypes (string $field_name, array $types)
 
 updateValues (&$values)
 
 deleteValues ($values)
 
 findValues ($values)
 
 insertValues (&$values)
 
 loadValues (&$values)
 
 validateValues ($values)
 
 getStoredTypes ()
 
- Public Member Functions inherited from Drupal\tripal\TripalStorage\TripalStorageBase
 __construct (array $configuration, $plugin_id, $plugin_definition, TripalLogger $logger)
 
 addFieldDefinition (string $field_name, object $field_definition)
 
 getFieldDefinition (string $field_name)
 
 getTypes ()
 
 getPropertyType (string $field_name, string $key)
 
 removeTypes (string $field_name, array $types)
 
 publishForm ($form, FormStateInterface &$form_state)
 
 publishFormValidate ($form, FormStateInterface &$form_state)
 
 publishFromSubmit ($form, FormStateInterface &$form_state)
 
- Public Member Functions inherited from Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface
 getStoredValues ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Drupal\tripal\TripalStorage\TripalStorageBase
static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 
- Protected Member Functions inherited from Drupal\tripal\TripalStorage\TripalStorageBase
 cloneValues ($values)
 
 addEmptyValuesItem (&$values, $field_name)
 
- Protected Attributes inherited from Drupal\tripal\TripalStorage\TripalStorageBase
 $logger
 
 $field_definitions = []
 
 $property_types = []
 

Detailed Description

Chado implementation of the TripalStorageInterface.

@TripalStorage( id = "drupal_sql_storage", label = @Translation("Drupal SQL Storage"), description = @Translation("This storage backend is used for fields which would like to use the default Drupal SQL-based field storage with a Tripal-based Field."), )

Member Function Documentation

◆ addTypes()

Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage::addTypes ( string  $field_name,
array  $types 
)

inheritdoc}

OVERRIDES TripalStorageBase to ensure all field properties are set to save to Drupal!

Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.

◆ deleteValues()

Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage::deleteValues (   $values)

Deletes the given array of property values from this tripal storage plugin.

Parameters
array$valuesArray of \Drupal\tripal\TripalStorage\StoragePropertyValue objects.
Returns
bool True if successful. False otherwise.

Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.

◆ findValues()

Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage::findValues (   $values)

Finds and returns all property values stored in this storage plugin implementation that matches the given match argument.

Parameters
array$valuesAssociative array 5-levels deep. The 1st level is the field name (e.g. ChadoOrganismDefault). The 2nd level is the delta value (e.g. 0). The 3rd level is a field key name (i.e. record_id + value). The 4th level must contain the following three keys/value pairs
  • "value": a \Drupal\tripal\TripalStorage\StoragePropertyValue object
  • "type": a\Drupal\tripal\TripalStorage\StoragePropertyType object
  • "definition": a \Drupal\Field\Entity\FieldConfig object When the function returns, any values retrieved from the data store will be set in the StoragePropertyValue object.
Returns
array
Todo:
fix this return value... Array of all \Drupal\tripal\TripalStorage\StoragePropertyValue objects that match.

Todo:
: impelment this function properly

Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.

◆ getStoredTypes()

Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage::getStoredTypes ( )

Returns a list of property types that should be stored.In order to link data in the storage backend, the storage system must link the record in someway with Drupal entities. This most likely happens in tables in the Drupal schema (usually the public schema). This function should return the list of properties that must be stored in order to uniquely identify an entity in the datastore.

Returns
@array Array of \Drupal\tripal\Base\StoragePropertyTypeBase objects.

Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.

◆ insertValues()

Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage::insertValues ( $values)

Inserts values in the field data store.The record Ids of the inserted records will be set in the property value objects.

Parameters
array$valuesAssociative array 5-levels deep. The 1st level is the field name (e.g. ChadoOrganismDefault). The 2nd level is the delta value (e.g. 0). The 3rd level is a field key name (i.e. record_id + value). The 4th level must contain the following three keys/value pairs
  • "value": a \Drupal\tripal\TripalStorage\StoragePropertyValue object
  • "type": a\Drupal\tripal\TripalStorage\StoragePropertyType object
  • "definition": a \Drupal\Field\Entity\FieldConfig object When the function returns, any values retrieved from the data store will be set in the StoragePropertyValue object.
Returns
bool True if successful. False otherwise.

Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.

◆ loadValues()

Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage::loadValues ( $values)

Loads the values of the field data store.

Parameters
array$valuesAssociative array 5-levels deep. The 1st level is the field name (e.g. ChadoOrganismDefault). The 2nd level is the delta value (e.g. 0). The 3rd level is a field key name (i.e. record_id + value). The 4th level must contain the following three keys/value pairs
  • "value": a \Drupal\tripal\TripalStorage\StoragePropertyValue object
  • "type": a\Drupal\tripal\TripalStorage\StoragePropertyType object
  • "definition": a \Drupal\Field\Entity\FieldConfig object
Returns
bool True if successful. False otherwise.

Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.

◆ updateValues()

Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage::updateValues ( $values)

Updates values in the field data store.

Parameters
array$valuesAssociative array 5-levels deep. The 1st level is the field name (e.g. ChadoOrganismDefault). The 2nd level is the delta value (e.g. 0). The 3rd level is a field key name (i.e. record_id + value). The 4th level must contain the following three keys/value pairs
  • "value": a \Drupal\tripal\TripalStorage\StoragePropertyValue object
  • "type": a\Drupal\tripal\TripalStorage\StoragePropertyType object
  • "definition": a \Drupal\Field\Entity\FieldConfig object When the function returns, any values retrieved from the data store will be set in the StoragePropertyValue object.
Returns
bool True if successful. False otherwise.

Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.

◆ validateValues()

Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage::validateValues (   $values)

Performs validation checks on values.

Parameters
array$valuesArray of \Drupal\tripal\TripalStorage\StoragePropertyValue objects.
Returns
array An array of \Symfony\Component\Validator\ConstraintViolation objects.

Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.


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