|
Tripal
|


Public Member Functions | |
| __construct (array $configuration, $plugin_id, $plugin_definition, TripalLogger $logger) | |
Public Member Functions inherited from Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface | |
| getStoredTypes () | |
| getNonStoredTypes () | |
| getStoredValues () | |
| insertValues (&$values) | |
| updateValues (&$values) | |
| loadValues (&$values, bool $ignore_cached_fields=TRUE) | |
| deleteValues ($values) | |
| findValues ($values) | |
| validateValues ($values) | |
Static Public Member Functions | |
| static | create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) |
Protected Attributes | |
| $logger | |
| $field_definitions = [] | |
| $property_types = [] | |
| $cached_fields = [] | |
| bool | $default_is_required = TRUE |
| addFieldDefinition (string $field_name, object $field_definition) | |
| getFieldDefinition (string $field_name) | |
| addTypes (string $field_name, array $types) | |
| getTypes () | |
| getPropertyType (string $field_name, string $key) | |
| removeTypes (string $field_name, array $types) | |
| markPropertiesForCaching (string $field_name, array &$prop_types) | |
| isDrupalStoreByFieldNameKey (string $field_name, string $key, object|null $property_type=NULL) | |
| publishForm ($form, FormStateInterface &$form_state) | |
| publishFormValidate ($form, FormStateInterface &$form_state) | |
| publishFromSubmit ($form, FormStateInterface &$form_state) | |
| cloneValues ($values) | |
| resetValuesItem (&$values, $field_name, $delta) | |
The base class for TripalStorage plugins.
| Drupal\tripal\TripalStorage\TripalStorageBase::__construct | ( | array | $configuration, |
| $plugin_id, | |||
| $plugin_definition, | |||
| TripalLogger | $logger | ||
| ) |
Implements __construct().
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.
| array | $configuration | The configuration for the current plugin instance. |
| string | $plugin_id | The unique ID for the current plugin instance. |
| mixed | $plugin_definition | The definition of the current plugin instance. |
| \Drupal\tripal\Services\TripalLogger | $logger | An instance of the Tripal logger to log messages to the admin. |
| Drupal\tripal\TripalStorage\TripalStorageBase::addFieldDefinition | ( | string | $field_name, |
| object | $field_definition | ||
| ) |
Adds the field definition to our storage plugin instance for later use.
inheritdoc}
Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.
Reimplemented in Drupal\tripal_chado\Plugin\TripalStorage\ChadoStorage.
| Drupal\tripal\TripalStorage\TripalStorageBase::addTypes | ( | string | $field_name, |
| array | $types | ||
| ) |
Adds property type objects for a specific field.
inheritdoc}
Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.
Reimplemented in Drupal\tripal\Plugin\TripalStorage\DrupalSqlStorage.
|
protected |
A helper function to clone a values array.
| array | $values | An array of property values. |
|
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 constructor.
| \Symfony\Component\DependencyInjection\ContainerInterface | $container | The container holding the services. |
| array | $configuration | Configuration for the current plugin instance. |
| string | $plugin_id | The unique ID of the current plugin instance. |
| mixed | $plugin_definition | The definition of the current plugin instance. |
Reimplemented in Drupal\tripal_chado\Plugin\TripalStorage\ChadoStorage.
| Drupal\tripal\TripalStorage\TripalStorageBase::getFieldDefinition | ( | string | $field_name | ) |
Gets a previously added field definition.
inheritdoc}
Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.
| Drupal\tripal\TripalStorage\TripalStorageBase::getPropertyType | ( | string | $field_name, |
| string | $key | ||
| ) |
Gets property type objects for a specific field.
inheritdoc}
Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.
| Drupal\tripal\TripalStorage\TripalStorageBase::getTypes | ( | ) |
Gets property type objects for all fields.
inheritdoc}
Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.
| Drupal\tripal\TripalStorage\TripalStorageBase::isDrupalStoreByFieldNameKey | ( | string | $field_name, |
| string | $key, | ||
| object|null | $property_type = NULL |
||
| ) |
Check if a single field property should be cached in the Drupal tables.This interacts with tripal_entity_type.default_cache_backend_field_values setting in the base implementation of this method.WARNING: This method should only be called after the property type for this field.key combo has been added.
| string | $field_name | The name of the field thhe property to check is part of. |
| string | $key | The storage property key to check. |
| object | null | $property_type | An instance of the propertyType to be checked. Optional. If not provided it will be looked up by the field name and key. |
Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.
Reimplemented in Drupal\tripal_chado\Plugin\TripalStorage\ChadoStorage.
| Drupal\tripal\TripalStorage\TripalStorageBase::markPropertiesForCaching | ( | string | $field_name, |
| array & | $prop_types | ||
| ) |
Marks which properties should be stored in the Drupal field tables.Uses isDrupalStoreByFieldNameKey() to mark each property type as whether it should be cached in the Drupal tables or not. This should be done before calling TripalEntity::tripalClear() on these property types.
| string | $field_name | The name of the field that the following property types are part of. |
| array | $prop_types | Array of \Drupal\tripal\TripalStorage\StoragePropertyType objects. |
Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.
| Drupal\tripal\TripalStorage\TripalStorageBase::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. |
Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.
Reimplemented in Drupal\tripal_chado\Plugin\TripalStorage\ChadoStorage.
| Drupal\tripal\TripalStorage\TripalStorageBase::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. |
Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.
| Drupal\tripal\TripalStorage\TripalStorageBase::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. |
Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.
| Drupal\tripal\TripalStorage\TripalStorageBase::removeTypes | ( | string | $field_name, |
| array | $types | ||
| ) |
Removes property types for a specific field.
inheritdoc}
Implements Drupal\tripal\TripalStorage\Interfaces\TripalStorageInterface.
|
protected |
Sets the values for a field to be empty.
If the delta value doesn't exist in the values array then a new values array is added.
| array | $values | An array of property values. |
| string | $field_name | The name of the field to addd an item to. |
| int | $delta | The index of the specific values item to reset. |