|
Tripal
|


Public Member Functions | |
| __construct (TripalIdSpaceManager $idSpaceManager, TripalVocabularyManager $vocabularyManager, TripalLogger $logger) | |
| setFieldDefDefaults (array $field_def=[]) | |
| install (array $collection_ids) | |
| addBundleField ($field_def) | |
Static Public Member Functions | |
| static | create (ContainerInterface $container) |
| static | getFieldArrayFromFieldInstance (FieldConfig $instance) |
Protected Member Functions | |
| updateFieldName (array $discovered_field) | |
| recheckTerms (array &$field_status, string $field_name) | |
Protected Attributes | |
| $idSpaceManager | |
| $vocabularyManager | |
| $logger | |
Provides an tripalStorage plugin manager.
| Drupal\tripal\Services\TripalFieldCollection::__construct | ( | TripalIdSpaceManager | $idSpaceManager, |
| TripalVocabularyManager | $vocabularyManager, | ||
| TripalLogger | $logger | ||
| ) |
Constructor
| Drupal\tripal\Services\TripalFieldCollection::addBundleField | ( | $field_def | ) |
Adds a field to a Tripal entity type.
| string | $bundle | The bundle name (e.g. organism). |
| array | $field_def | An associative array providing the necessary information about a field instance for this entity type. The following key/values are supported
|
An example field defintion:
|
static |
{}
|
static |
Provides a compatible array for a field based on it's Field Config.
This is to be used in the discover process to add existing fields to the field list in a standardized way.
| FieldConfig | $instance | The existing field to generate an array for so it can be added to the field list as an existing field. |
| Drupal\tripal\Services\TripalFieldCollection::install | ( | array | $collection_ids | ) |
Attaches fields to Tripal content types.
| array | $collection_ids | An array of the collection 'id' you would like to install. |
|
protected |
If a new field's name conflicts with an existing one, update the new field's name to eliminate the duplication.
| array | &$field_status | Holds the status of each field. Will be updated if necessary. |
| string | $field_name | Name of one existing field to check against |
| Drupal\tripal\Services\TripalFieldCollection::setFieldDefDefaults | ( | array | $field_def = [] | ) |
Adds default values for keys in the field definition array.
This function will only add defaults if the value is not already present in the $field_def array. You can retrieve a fully populated definition array, with defaults, by not passing an argument. This function will remove any keys in the definition array that are not supported.
|
protected |
Updates a field name if it is already used for a different field.
| string | $discovered_field | Current field with duplicated name |
|
protected |
The IdSpace service
|
protected |
A logger object.
|
protected |
The vocabulary service