Tripal
|
Public Member Functions | |
addTypes (string $field_name, array $types) | |
removeTypes (string $field_name, array $types) | |
getTypes () | |
getPropertyType (string $field_name, string $key) | |
addFieldDefinition (string $field_name, object $field_definition) | |
getFieldDefinition (string $field_name) | |
getStoredTypes () | |
getStoredValues () | |
insertValues (&$values) | |
updateValues (&$values) | |
loadValues (&$values) | |
deleteValues ($values) | |
findValues ($values) | |
validateValues ($values) | |
publishForm ($form, FormStateInterface &$form_state) | |
publishFormValidate ($form, FormStateInterface &$form_state) | |
publishFromSubmit ($form, FormStateInterface &$form_state) | |
Defines an interface for tripal storage plugins.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::addFieldDefinition | ( | string | $field_name, |
object | $field_definition | ||
) |
Stores the field definition for a given field.
NOTE: the definition for every field mentioned in the values array of an insert/update/load/find/deleteValues() method must be added using this function before the *Values() method can be called.
string | $field_name | The name of the field based on it's annotation 'id'. |
object | $field_definition | The field configuration object. This can be an instance of: \Drupal\field\Entity\FieldStorageConfig or \Drupal\field\Entity\FieldConfig |
Implemented in Drupal\tripal_chado\Plugin\TripalStorage\ChadoStorage, and Drupal\tripal\TripalStorage\TripalStorageBase.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::addTypes | ( | string | $field_name, |
array | $types | ||
) |
Adds the given array of new property types to this tripal storage plugin.
string | $field_name | The name of the field the properties belong to. |
array | $types | Array of \Drupal\tripal\TripalStorage\StoragePropertyTypeBase objects. |
Implemented in Drupal\tripal\TripalStorage\TripalStorageBase, and Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::deleteValues | ( | $values | ) |
Deletes the given array of property values from this tripal storage plugin.
array | $values | Array of \Drupal\tripal\TripalStorage\StoragePropertyValue objects. |
Implemented in Drupal\tripal_chado\Plugin\TripalStorage\ChadoStorage, and Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::findValues | ( | $values | ) |
Finds and returns all property values stored in this storage plugin implementation that matches the given match argument.
array | $values | Associative 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
|
Implemented in Drupal\tripal_chado\Plugin\TripalStorage\ChadoStorage, and Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::getFieldDefinition | ( | string | $field_name | ) |
Retrieves the stored field definition of a given field.
string | $field_name | The name of the field based on it's annotation 'id'. |
Implemented in Drupal\tripal\TripalStorage\TripalStorageBase.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::getPropertyType | ( | string | $field_name, |
string | $key | ||
) |
Returns a single propertyType object based on the parameters.
string | $bundle_name | The name of the bundle on which the field is attached that the properties belong to. |
string | $field_name | The name of the field the properties belong to. |
string | $key | The key of the property type to return. |
Implemented in Drupal\tripal\TripalStorage\TripalStorageBase.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::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.
Implemented in Drupal\tripal_chado\Plugin\TripalStorage\ChadoStorage, and Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::getStoredValues | ( | ) |
Returns a list of property values for stored types..
This function returns an array of property value objects that correspond to the types returned by getStoredTypes().
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::getTypes | ( | ) |
Returns a list of all property types added to this storage plugin type. WARING! This could be a very expensive call!
Implemented in Drupal\tripal\TripalStorage\TripalStorageBase.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::insertValues | ( | & | $values | ) |
Inserts values in the field data store.
The record Ids of the inserted records will be set in the property value objects.
array | $values | Associative 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
|
Implemented in Drupal\tripal_chado\Plugin\TripalStorage\ChadoStorage, and Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::loadValues | ( | & | $values | ) |
Loads the values of the field data store.
array | $values | Associative 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
|
Implemented in Drupal\tripal_chado\Plugin\TripalStorage\ChadoStorage, and Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::publishForm | ( | $form, | |
FormStateInterface & | $form_state | ||
) |
Provides form elements to be added to the Tripal entity publish form.
array | $form | The form array definition. |
\Drupal\Core\Form\FormStateInterface | $form_state | The form state object. |
Implemented in Drupal\tripal_chado\Plugin\TripalStorage\ChadoStorage, and Drupal\tripal\TripalStorage\TripalStorageBase.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::publishFormValidate | ( | $form, | |
FormStateInterface & | $form_state | ||
) |
Handles validation of the publish form elements.
array | $form | The form array definition. |
\Drupal\Core\Form\FormStateInterface | $form_state | The form state object. |
Implemented in Drupal\tripal\TripalStorage\TripalStorageBase.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::publishFromSubmit | ( | $form, | |
FormStateInterface & | $form_state | ||
) |
Handles submission of the form elements for the storage backend.
array | $form | The form array definition. |
\Drupal\Core\Form\FormStateInterface | $form_state | The form state object. |
Implemented in Drupal\tripal\TripalStorage\TripalStorageBase.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::removeTypes | ( | string | $field_name, |
array | $types | ||
) |
Removes the given array of property types from this tripal storage plugin.
string | $field_name | The name of the field the properties belong to. |
array | $types | Array of \Drupal\tripal\TripalStorage\StoragePropertyTypeBase objects. |
Implemented in Drupal\tripal\TripalStorage\TripalStorageBase.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::updateValues | ( | & | $values | ) |
Updates values in the field data store.
array | $values | Associative 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
|
Implemented in Drupal\tripal_chado\Plugin\TripalStorage\ChadoStorage, and Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage.
Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface::validateValues | ( | $values | ) |
Performs validation checks on values.
array | $values | Array of \Drupal\tripal\TripalStorage\StoragePropertyValue objects. |
Implemented in Drupal\tripal_chado\Plugin\TripalStorage\ChadoStorage, and Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage.